
GCC 6.1 Released - edelsohn
https://gcc.gnu.org/ml/gcc/2016-04/msg00244.html
======
jordigh
I recently compiled a contribution graph (number of lines changed per user)
for gcc since 2015 using Mercurial's churn command and a simple revset:

[http://paste.debian.net/plain/442020](http://paste.debian.net/plain/442020)

(I excluded the po files, as that gives one user too much credit, since he
just checked in the translations, but didn't write them himself.)

This is a rather unusual contribution graph. Most I've seen follow a very
stark power law, with one contributor doing over 90% of the work, and the
second contributor doing around 5%. This graph shows a lot more collaboration
from many people. The development of gcc seems healthier than ever!

~~~
misframer
I believe "ian" on that list is Ian Lance Taylor. He's on the Go team and
works on gccgo so I think most of his contributions [0] are for the Go
compiler.

[0] Example commit: [https://github.com/gcc-
mirror/gcc/commit/b0c0971248103432dd6...](https://github.com/gcc-
mirror/gcc/commit/b0c0971248103432dd623276227da9cd69a755cf)

~~~
geofft
Ian Lance Taylor was working on GCC and binutils long before Go ever existed.
He also wrote the gold linker.

It would be interesting if most of his contributions recently have shifted to
gccgo, though!

------
jason_slack
Honest question: on OS X, Apple has embraced clang and not gcc anymore. When I
use linux clang is also available.

Can anyone chime in about how a developer would choose gcc over clang (and
vice versa). I have to admit that even though I write in c++, I seldom pay
attention to which compiler I would use for x vs y feature, etc. Compilers
feel like a black-box to me. I don't go inside it.

Edit: I don't know about Windows, I know gcc is available. I haven't looked if
clang is.

Edit 2: Intel also makes compilers, to which I own, but never use. I guess I
feel like I am not doing anything specific to Intel

~~~
gravypod
GCC, from my experience, generates much faster binaries.

Clang is much faster at compiling though. It's a trade off.

~~~
PeCaN
That was the case circa 2012 with Clang 3.1 and GCC 4.7, but both have closed
the gaps. Clang generates code roughly as fast as GCC and GCC compiles about
as fast as Clang.

~~~
agumonkey
funny how this opposite spectrum leads to
[https://upload.wikimedia.org/wikipedia/commons/7/7c/Vector_A...](https://upload.wikimedia.org/wikipedia/commons/7/7c/Vector_Addition.png)

risc / cisc gathered around each other, clang / gcc...

progress by antagonism

------
wyldfire
> This releases features various improvements in the emitted diagnostics,
> including improved locations, location ranges, suggestions for misspelled
> identifiers, option names etc., fix-it hints and a couple of new warnings
> have been added.

Every time I hear about new GCC releases all I can think of is how the
compiler wars have clearly inspired lots of new feature development. From the
high level it seems like GCC is still catching up with clang. Are there cases
where GCC has leapt ahead of clang in some features?

~~~
mordocai
I believe the discussion in the other comment thread is correct in that GCC
generates better binaries.

~~~
mioelnir
I always find it amusing that in any 'clang compiles faster, gcc provides
better binaries' discussion there are always immediately people chiming in
that this is based on old data from gcc 4.9. But clang supposedly hasn't
improved its binaries in all that time?

Unless you target a feature or cpu architecture that only one of them
supports, it is close to a coin toss nowadays which compiler builds the faster
binary.

------
manaskarekar
>The C++ frontend now defaults to C++14 standard instead of C++98 it has been
defaulting to previously

Honest question, in production, is this sort of a thing pretty much a non-
issue?

Edit: Sorry, to be clearer, I meant to ask, effect of stuff like changing
defaults between different versions. Perhaps, it is a non-issue because most
production code is (/maybe) version locked.

Also, a little vague, but out of curiosity, how often do C / C++ shops upgrade
to the latest and greatest?

~~~
unwind
I work in embedded software, and I've sometimes felt mildly reactionary for
suggesting that yeah, we can use C99. It's not "new". Really! We have "bool"
now, for when things are, you know, Boolean! And we can declare variables
where we need them, not in a huge prelude in the function ...

~~~
phkahler
more importantly you can - and should - use int16_t and int32_t.

~~~
Gibbon1
I know they are C99 but I swear I was using stdint or something like it circa
1996

------
larozin
We get it:

> C++ Concepts are now supported when compiling with -fconcepts.

------
cm3
I've recently had to enable C++11 in a project because a header I use added
C++11 features, and it appears that going from C++98 to C++11 makes Clang and
G++ considerably slower. Can anybody else confirm this?

~~~
majewsky
Did you test the --std change in isolation, without your new headers? Some
libraries' headers are ridiculously expensive when they make heavy use of
templates. My favorite in that regard is Boost::Qi.

~~~
cm3
How do I test it in isolation without including and making use it as before
(aka no code change in the consumer of the previously C++98 header)?

~~~
netheril96
Just compile the previous version that conforms to C++98 with different std
flags and do the comparison.

~~~
cm3
Right, that makes sense. Will do, though once confirmed, I will curse C++1x
even more, I guess :).

------
the_mitsuhiko
What happened to 6.0.

~~~
Aissen
It was the development version.

See "Version Numbering Scheme for GCC 5 and Up" here
[https://gcc.gnu.org/develop.html](https://gcc.gnu.org/develop.html) .

~~~
hyperpape
I'm still confused after reading this. Does this mean that 6.0, 6.1.1, 6.2.1
etc. do not actually name specific code bases that can be downloaded? Or is
6.0 the name of a specific commit in the code?

~~~
geofft
Between GCC 4.9 and GCC 5, they made basically the same change Linux made
between 2.6.39 and 3.0: they dropped one of the components in the version
number. The amount of change between GCC 5, 6, 7, etc. are equivalent to the
amount of change between 4.7, 4.8, 4.9, etc.

They're also using the version 0 in the second component to indicate
prereleases. GCC 6.0.0 was the development version of GCC 6. The release
candidate was 6.0.1. The first release of GCC 6, which came out today, is
6.1.0. Then there will be development under the name 6.1.1, and the first
bugfix release on the GCC 6 line will be 6.2.0. The amount of change between
6.1.0 and 6.2.0 is equivalent to the amount of change between 4.9.0 and 4.9.1
in the old numbering scheme.

~~~
hyperpape
Thanks for the explanation. I realize this is bikeshedding, but is there a
rationale behind using 6.0.1 as a release candidate? I get making major
versions less rare, but not sure I get he rest of it.

------
beeforpork
And again, my favorite accidental usages of undefined behaviour in C++ are
optimised into BS.

(1) if (this == NULL): this is super useful in non-virtual functions, because
NULL is the object that subclasses all classes, so the only universal error
object.

(2) memset in operator new: in C++03, we did not have initialisers inside
struct{}, so quicky zero the obj to avoid error-prone manual inits of all
embedded ints.

This is really becoming ridiculous. Having a notion of how C/C++ corresponds
to what the machine will do seems to be more and more regarded as evil.

~~~
Matheus28
Except `if(this == nullptr)` doesn't always work:
[https://blogs.msdn.microsoft.com/oldnewthing/20160224-00/?p=...](https://blogs.msdn.microsoft.com/oldnewthing/20160224-00/?p=93081)

You might get a pointer to NULL+8 or something like that if the class
inherents from more than one class.

Maybe you should just write compliant code after all.

------
nhamausi
Hurray for C++14 "by default"

------
Filligree
Oh, hooray. I wonder which programs are going to break because of
optimizations this time?

~~~
treehau5
I think this type of thinking is cynical and unhelpful. We complain that
compiler technology is not keeping pace, then when they put in god knows how
many hundreds of hours of work improving, we complain when we might have to
spend a few to go back through our programs and make sure everything's okay.
We want everyone else to do the work for us.

~~~
lmm
> We complain that compiler technology is not keeping pace

Who was complaining about that?

> when they put in god knows how many hundreds of hours of work improving, we
> complain when we might have to spend a few to go back through our programs
> and make sure everything's okay. We want everyone else to do the work for
> us.

Their whole job is to compile our programs - what else is a compiler good for?
I don't know who GCC's users are these days - people who care more about
benchmarks than working code? Because that seems to be who they're optimising
for. Then again I suppose that's the entirety of C/C++'s market these days.

~~~
dave2000
Are you saying you have an example of valid c++ code which fails to compile,
and that this problem is getting worse, or just that you get unexpected
behaviour when write bad code?

~~~
lmm
"Valid" in that the standard absolutely requires that compilers give them some
particular meaning, no matter how rules-lawyery the compiler is? No. "Valid"
in the sense that the intent is perfectly obvious to any reader? Yes, plenty.
"bad"? No, unless you use the standard as your definition of good/bad.

~~~
lomnakkus
> the intent is perfectly obvious to any reader

So compilers need to judge what is "perfectly obvious to any reader", now? And
you're willing to deal with the fallout of different compilers having
different conceptions of "perfectly obvious"?

That's... an ambitious project.

Maybe your time would be better spent convincing the C++ committee to _define_
some more behavior instead of leaving it undefined.

~~~
lmm
The C++ committee exists to standardise the behaviour that major compilers
implement. Trying to get them to define behaviour where there isn't already at
least broad support would be putting the cart before the horse.

