Live data from Hacker News

GCC 7 Release Series – Changes, New Features, and Fixes

gcc.gnu.org

11–20 of 87 posts

Re: GCC 7 Release Series – Changes, New Features, and Fixes

#13
post #9
post #3

Earlier quoted context omitted.

For gcc-4.3 this was a no contest, clang was clearly better. However, gcc has made up a lot of ground over the years, to the point that I now consider gcc's template based error messaes better. It is very difficult to keep personal judgement and tastes out of the equation so ymmv. If the error message of one is not very illuminating I often try the other compiler on the same piece of code. It is a good practice anywa…

> If the error message of one is not very illuminating I often try the other compiler on the same piece of code. It is a good practice anyway and I should be doing more of that. It actually is a good idea to regularly build and test C/C++ codebases with both gcc and clang because not only error diagnostics are different but also warnings and optimizations, including crazy optimizations exploiting undefined behavior.…

My first experience with UB:

    foo(bar(), bar());
(where bar() was stateful)

Discovering that g++ and clang++ compiled to one that did what I wanted and one that didn't was an interesting experience.

Re: GCC 7 Release Series – Changes, New Features, and Fixes

#14

It's only a matter of time before llvm/clang overshadows gcc in every aspect, if it hasn't already. clang probably has 10x more full-time developers than gcc does.

Maybe, maybe not.

I've been seeing this comment for the past 7-6 years, and GCC still delivers better performance on the majority of real-world programs I benchmark (mostly compression).

What I find very strange though is that some people seemingly want one of these projects to die.

As is evident from many of the replies in this thread, having two great compiler toolchains with which to test your code is a great advantage.

Secondly, looking at how GCC development picked up greatly when Clang/LLVM came on stage, it shows that GCC was stagnating with the lack of direct competition, should one of them disappear now, the same thing is likely to happen to the surviving project.

On the contrary, I would prefer having even more competition in this field.

Re: GCC 7 Release Series – Changes, New Features, and Fixes

#15
post #14

It's only a matter of time before llvm/clang overshadows gcc in every aspect, if it hasn't already. clang probably has 10x more full-time developers than gcc does.

Maybe, maybe not. I've been seeing this comment for the past 7-6 years, and GCC still delivers better performance on the majority of real-world programs I benchmark (mostly compression). What I find very strange though is that some people seemingly want one of these projects to die. As is evident from many of the replies in this thread, having two great compiler toolchains with which to test your code is a great adva…

> What I find very strange though is that some people seemingly want one of these projects to die.

I don't think people want, I think people are worried that this will happen. It's pretty clear that commercial backing largely favours LLVM for obvious reasons. A compiler monoculture nobody really wants back.

Re: GCC 7 Release Series – Changes, New Features, and Fixes

#16
post #6
post #4

On mainstream native platforms, Ada programs no longer require the stack to be made executable in order to run properly. What does that even mean? I'm dabbling with Ada as of recently. Also, woo! Support for the RISC-V instruction set has been added. On topic, I'm using GCC5 and 6 as well as experimenting with 7, and I also have Clang - all available to me via switch/simple shell functions. I always tend to have my j…

>What does that even mean? I know nothing about Ada but there is a feature called called 'executable bit' in pretty much all desktop processors since 1-2 decades. What this bit does is it marks certain regions of memory as not executable, i.e. you're not allowed to put the instruction pointer onto that region and let the CPU run the instructions. This is a hardware-level feature and can be disabled in BIOS/UEFI. Usua…

>Why Ada needed this disabled is beyond me. Does it execute things on the stack?

I believe this is due to nested function support. There is some explanation here: https://stackoverflow.com/questions/34982151/executable-ada-...

Re: GCC 7 Release Series – Changes, New Features, and Fixes

#17

It's only a matter of time before llvm/clang overshadows gcc in every aspect, if it hasn't already. clang probably has 10x more full-time developers than gcc does.

It’s a similar story as with Firefox and Chrome, and you’re sadly right.

The free software community is more than ever before at risk of being replaced by a monopoly culture controlled by large corporations.

Re: GCC 7 Release Series – Changes, New Features, and Fixes

#18
post #10
post #2

If you compare (gcc7 and latest clang), how much in pair is gcc with clang in terms of compilation warnings? (One of the most valuable tool of a compiler). I'm really happy they are moving in the same direction; I've been worried about gcc.

Where clang now clearly leads is in terms of runtime security and debugging features. Both share asan (address sanitizer), ubsan (undefined behavior) and tsan (threads). But msan (memory sanitizer, finds uninitialized memory use) is only available in clang. In terms of exploit mitigation clang now has control flow integrity and safestack, as far as I'm aware nothing like this is available in gcc. msan may not be such…

gcc has ubsan too, and various stack overflow checking mechanisms.

Re: GCC 7 Release Series – Changes, New Features, and Fixes

#19
post #9

Earlier quoted context omitted.

> If the error message of one is not very illuminating I often try the other compiler on the same piece of code. It is a good practice anyway and I should be doing more of that. It actually is a good idea to regularly build and test C/C++ codebases with both gcc and clang because not only error diagnostics are different but also warnings and optimizations, including crazy optimizations exploiting undefined behavior.…

My first experience with UB: foo(bar(), bar()); (where bar() was stateful) Discovering that g++ and clang++ compiled to one that did what I wanted and one that didn't was an interesting experience.

It gets even funnier in OCaml where they nominally defined it UB in order to get the freedom to make the only existing implementation always 100% reliably evaluate right-to-left, which reportedly was better for performance or something :)

And before somebody wonders about currying and eager evaluation, the problem is not functions but type constructors, which aren't curried.

Re: GCC 7 Release Series – Changes, New Features, and Fixes

#20
post #17

It's only a matter of time before llvm/clang overshadows gcc in every aspect, if it hasn't already. clang probably has 10x more full-time developers than gcc does.

It’s a similar story as with Firefox and Chrome, and you’re sadly right. The free software community is more than ever before at risk of being replaced by a monopoly culture controlled by large corporations.

That's what you get when you prefer programs that are merely open source to free software.
Post reply on HN