News for hackers. Stuff that matters.
Re:GCC 5.2 released by lifeisstillgood on Thursday July 16, 2015 @10:47AM (#9897524)
It's worth celebrating (well, noting in an approving manner) this release. GCC is a foundation stone project for, well, a huge amount of the world's wealth.

It is a healthy project (even with CLang etc), and with the heartbleed post mortem on our minds we should probably ask what can be done to keep it and others healthy - auditing, foundation status etc.

So thank you GCC developers, for making sure I do not need to worry about something.

Re:GCC 5.2 released by agwa on Thursday July 16, 2015 @11:37AM (#9897851)
It's worth noting that, due to GCC's new and esoteric version numbering scheme[1], this is a bugfix-only release on the 5.x branch. The bigger news was when GCC 5.1 (a major stable release) was released in April. That said, GCC 5.2 fixes a pretty serious bug that I was hitting so I'm happy to hear about it!

[1] https://gcc.gnu.org/develop.html#num_scheme

Re:GCC 5.2 released by 3JPLW on Thursday July 16, 2015 @01:53PM (#9898784)
Woah, new and esoteric indeed!

    X.0.0 is experimental development
    X.0.1 is pre-release stabilization stage
    X.1.0 is the stable release
    X.1.1 is development of release branch (fixes and backports)
    X.2.0 is the second stable release
It looks like only X.1.0, X.2.0, etc uniquely tag a single point in the development history. Are all the others just moving labels?
Re:GCC 5.2 released by rst on Thursday July 16, 2015 @01:19PM (#9898523)
They switched the default C compilation mode from --std=gnu89 to --std=gnu11 in a bugfix-only release?
Re:GCC 5.2 released by agwa on Thursday July 16, 2015 @01:24PM (#9898551)
No, they did that in 5.1. The linked page is mostly about the overall 5.x series, with a tiny little section at the bottom about 5.2.
Re:GCC 5.2 released by uxcn on Thursday July 16, 2015 @03:02PM (#9899242)
I hope more projects start using it (or C99) over C89.
Re:GCC 5.2 released by the8472 on Thursday July 16, 2015 @11:09AM (#9897668)
> Write-only variables are now detected and optimized out.

That's probably something one should keep in mind when writing micro-benchmarks.

Re:GCC 5.2 released by nitrogen on Thursday July 16, 2015 @11:27AM (#9897781)
There should be a warning for this enabled in every C project.
Re:GCC 5.2 released by JoshTriplett on Thursday July 16, 2015 @01:52PM (#9898776)
GCC has a warning for that, and yes, it should be.
Re:GCC 5.2 released by spacehome on Thursday July 16, 2015 @11:58AM (#9897993)
I'm appalled that this wasn't taken care of 20 years ago. It seems like such low-hanging fruit.
Re:GCC 5.2 released by pcwalton on Thursday July 16, 2015 @03:34PM (#9899405)
I assume it means globals, which is significantly less trivial. Any SSA-based compiler, which GCC has been for years and years, trivially does this for locals.
Re:GCC 5.2 released by greglindahl on Thursday July 16, 2015 @12:46PM (#9898330)
This is a standard compiler feature, yes -- lots of real code out there has a lot of dead writes, such as debugging code that has been only partly removed or disabled. Historically, it's been a significant win for some of the SPECcpu benchmarks.
Re:GCC 5.2 released by astrange on Thursday July 16, 2015 @08:53PM (#9900794)
It's standard to remove local variables that are write-only, but globals aren't always defined to be unused even when you want them to be. If you're building a shared library and you exported the symbol, it has to leave it in as part of the API.

Link-time optimization can delete a lot more stuff when you're building a program directly, since it only has to keep main()… as long as you didn't go and use things like function pointers.

This is one reason I try to use '-fvisibility=hidden' in libraries, because it prevents anything from being part of the API unless you go back and specifically export it.

Re:GCC 5.2 released by anon4 on Thursday July 16, 2015 @03:55PM (#9899524)
Historically, it's been a significant win for some of the SPECcpu benchmarks.

But doesn't it mean that you're not really executing the full benchmark then?

Re:GCC 5.2 released by greglindahl on Thursday July 16, 2015 @04:40PM (#9899760)
No, because no one ever reads the dead data. These are not microbenchmarks that get broken by optimizations like this; SPECcpu programs have answers, and the goal is to output the answer. The answer is tested. Anything you can delete from the program is fair game.
Re:GCC 5.2 released by ot on Thursday July 16, 2015 @11:55AM (#9897972)
[deleted]
Re:GCC 5.2 released by mrpippy on Thursday July 16, 2015 @11:33AM (#9897825)
Those pointers always need to be defined as volatile anyway
[deleted]
Re:GCC 5.2 released by zyngaro on Thursday July 16, 2015 @12:00PM (#9898009)
The point of using volatile is to make sure not to put the variable in a register or use a cached value; it hits the memory.
Re:GCC 5.2 released by Meai on Thursday July 16, 2015 @10:56AM (#9897590)
Does GCC support modules? http://clang.llvm.org/docs/Modules.html
Re:GCC 5.2 released by RoboSeldon on Thursday July 16, 2015 @11:09AM (#9897667)
gfortran which is part of GCC supports modules (this is because Fortran the language supports modules).

If you meant modules for C or C++, no (as far as I know), probably because C and C++ have no standard for modules. In a recent talk Bjarne Stroustroup talks about his hope that C++17 will include support for modules https://www.youtube.com/watch?v=2egL4y_VpYg

Re:GCC 5.2 released by cozzyd on Thursday July 16, 2015 @11:12AM (#9897688)
It probably will once the C++ committee figures out how they want to do it...
Re:GCC 5.2 released by ademarre on Thursday July 16, 2015 @11:47AM (#9897919)
With this release the golang frontend catches up it'so Go version 1.4.2.

EDIT: I'm wrong. That was GCC 5.1.

Re:GCC 5.2 released by sajal83 on Thursday July 16, 2015 @12:02PM (#9898032)
Nopes. Go 1.4.2 was released with GCC 5.1 (April 22, 2015). This release is just bugfixes.
Re:GCC 5.2 released by ademarre on Thursday July 16, 2015 @01:05PM (#9898443)
Thanks; you're right. I read the 5 series general release notes as if it were for 5.2.
Re:GCC 5.2 released by bsdetector on Thursday July 16, 2015 @12:43PM (#9898316)
I'm more interested in why GCC still doesn't have a D frontend.

Back when people were criticizing Google for acquiring GCC developers and then adding their own Go language I think they promised to add D in like 4.6 or something like that.

Re:GCC 5.2 released by jlarocco on Thursday July 16, 2015 @02:07PM (#9898906)
I don't know anything about that, but there's already a D front end for GCC: http://gdcproject.org
Re:GCC 5.2 released by tosseraccount on Thursday July 16, 2015 @10:49AM (#9897541)
Any benchmarks? How does this compare with previous versions of gcc?
Re:GCC 5.2 released by joosters on Thursday July 16, 2015 @11:29AM (#9897801)
The release notes mention several benchmark comparisons.
Re:GCC 5.2 released by gtk40 on Thursday July 16, 2015 @01:50PM (#9898763)
I don't see any benchmarks showing improvements in 5.2. The 5.2 information seems sparse. Could you point this out?
Re:GCC 5.2 released by revskill on Thursday July 16, 2015 @11:31AM (#9897814)
You should investigate by yourself :)
Re:GCC 5.2 released by minot on Thursday July 16, 2015 @04:20PM (#9899664)
Hi guys, any idea when we might get this on mingw?
Re:GCC 5.2 released by rossy on Thursday July 16, 2015 @07:34PM (#9900520)
If you're using MSYS2 to get your MinGW compilers, the package has been updated, but you won't see builds on the mirrors until all the other packages have been rebuilt for GCC 5.1/5.2 (due to the ABI change.)

https://github.com/Alexpux/MINGW-packages/commit/a6a16a3

Re:GCC 5.2 released by anon3_ on Thursday July 16, 2015 @06:38PM (#9900312)
Where is GCC's place in the world now that there is LLVM/Clang?

Does the LLVM+Clang combo make GCC obsolete?