4 ms·
I know a company that used to build all code with both GCC and clang in parallel on every build, and use binary output from GCC but error/warning messages from
by knorker 4y ago
I know a company that used to build all code with both GCC and clang in parallel on every build, and use binary output from GCC but error/warning messages from clang.
- pizlonator 4y agoI wonder if GCC still has a codegen edge over clang. I know it used to. No idea if it’s still the case.
- aew4ytasghe5 4y agoFor x86 in certain cases, I think gcc produces better code still. But x86_64 / aarch64 looks different, and there I would assume the gap between gcc/clang is not big. Would be cool to hear more about this.
- sanxiyn 4y agoI think GCC had an edge up to 2020 or so, mainly thanks to its better inliner. I should check this again now LLVM's inliner rewrite landed.
- yjftsjthsd-h 4y agoHonestly if nothing else that sounds amazing from the perspective of maintaining portability. Allowing you to exploit the strengths of each compiler is also nice:)
- vbezhenar 4y agoIt is wise because this dichotomy won't last forever. GCC will slowly die (because corporations seems to hate GPL and LLVM is their child) and everyone will need to migrate to LLVM sooner or later.
- ndiddy 4y agoIronically, while LLVM lives on, Clang is slowly dying and is failing to compete with GCC. Clang's C++20 support lags behind GCC because both of its major corporate sponsors, Google and Apple, have seemingly moved on (after failing to get the ABI changed, Google went over to working on Carbon, and Apple doesn't care as long as the C++ support is good enough to compile LLVM and the C++14 subset required for Metal's shading language). All the other vendors who take advantage of Clang's permissive licensing seem unwilling to upstream improved C++ support.
- jeffbee 4y agoThat isn't quite what we did at Google but for many years we did use clang for humans and GCC for releases. It's a good compromise, IMHO.