Linked by Thom Holwerda on Tue 6th Mar 2018 20:08 UTC
Google

As of Chrome 64, Chrome for Windows is compiled with Clang. We now use Clang to build Chrome for all platforms it runs on: macOS, iOS, Linux, Chrome OS, Android, and Windows. Windows is the platform with the second most Chrome users after Android according to statcounter, which made this switch particularly exciting.

Thread beginning with comment 654336
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE: slow decline of GCC ?
by malxau on Wed 7th Mar 2018 09:10 UTC in reply to "slow decline of GCC ?"
malxau
Member since:
2005-12-04

I wonder if it's the technical merit of llvm in general, or gpl3 that's turning people away from gcc nowadays.


For me, it was pure code generation. For my relatively simple projects, clang would produce code that's about 10%-15% smaller than gcc. clang was still not quite as good as Visual C++, but gcc was an outlier. Turning your point around, what would be the reason to use gcc over clang?

Reply Parent Score: 3

RE[2]: slow decline of GCC ?
by kwan_e on Wed 7th Mar 2018 09:49 in reply to "RE: slow decline of GCC ?"
kwan_e Member since:
2007-02-18

For my relatively simple projects, clang would produce code that's about 10%-15% smaller than gcc.


After -O2 or -Os, I find they're both about the same. Clang is a much faster compiler, hands down. My understanding is that GCC can be overly aggressive in optimization so may end up generating code that isn't the best for relatively simple projects.

Reply Parent Score: 4

jessesmith Member since:
2010-03-11

The optimization thing is definitely true. I have tested code using GCC and Clang with various optimizations turned on. Code compiled with Clang would always run smoothly. Code compiled without optimizations on GCC would also run. But if I turned on optimizations under GCC, the program would crash. Some logic or checks were getting optimized out, but only under GCC, and causing instability.

Warnings and errors are more sane under Clang. The messages are much clearer with references to where things went wrong in Clang. GCC's errors are pretty cryptic in comparison.

I have also noticed GCC throwing incorrect warnings. Like "This variable is declared but unused." But looking through the code shows the variable is, in fact, used and cannot be removed. I still test code under GCC to see if it finds potential problems Clang doesn't, but I do almost all my work with Clang because it is so much more pleasant to use.

Reply Parent Score: 4