News for hackers. Stuff that matters.
Re:GCC 4.9 Release Series – Changes, New Features, and Fixes by twic on Saturday April 12, 2014 @05:19PM (#7579254)
The things that caught my eye were both related to IBM hardware features.

Firstly, apparently IBM chips have hardware transactional memory now:

  PowerPC / PowerPC64 / RS6000
    GCC now supports Power ISA 2.07, which includes support
    for Hardware Transactional Memory (HTM)
  
  S/390, System z
    Support for the Transactional Execution Facility
    included with the IBM zEnterprise zEC12 processor has
    been added.
That's pretty cool.

Also on the 390:

  S/390, System z
    The hotpatch features allows to prepare functions for
    hotpatching. A certain amount of bytes is reserved
    before the function entry label plus a NOP is inserted
    at its very beginning to implement a backward jump when
    applying a patch. The feature can either be enabled via
    command line option -mhotpatch for a compilation unit
    or can be enabled per function using the hotpatch
    attribute.
I guess if you're doing high availability the mainframe way, you don't get to restart your apps to patch them. That's terrifying, but again, pretty cool.
Re:GCC 4.9 Release Series – Changes, New Features, and Fixes by revelation on Saturday April 12, 2014 @05:46PM (#7579322)
Windows system DLLs have pointless "mov edi, edi" instructions in function prologues to enable hotpatching. It's not just mainframes ;)
Re:GCC 4.9 Release Series – Changes, New Features, and Fixes by jodrellblank on Saturday April 12, 2014 @09:50PM (#7579863)
Which I recently read about on Raymond Chen's blog. Link: http://blogs.msdn.com/b/oldnewthing/archive/2011/09/21/10214...
Re:GCC 4.9 Release Series – Changes, New Features, and Fixes by maximilianburke on Saturday April 12, 2014 @06:21PM (#7579428)
Yes, MSVC does this when the /hotpatch command line option is provided.
Re:GCC 4.9 Release Series – Changes, New Features, and Fixes by apaprocki on Saturday April 12, 2014 @08:56PM (#7579765)
You can read quick slides about the POWER8 transactional memory and general feature comparison here:

https://www-950.ibm.com/events/wwe/grp/grp030.nsf/vLookupPDF...

Re:GCC 4.9 Release Series – Changes, New Features, and Fixes by gsnedders on Saturday April 12, 2014 @06:27PM (#7579444)
One of the large design-constraints of Erlang is being able to hotpatch, given the uptime requirements for telephone switching.
Re:GCC 4.9 Release Series – Changes, New Features, and Fixes by krakensden on Saturday April 12, 2014 @04:18PM (#7579034)
> Memory usage building Firefox with debug enabled was reduced from 15GB to 3.5GB; link time from 1700 seconds to 350 seconds.

This is huge- you can now do this on a laptop

Re:GCC 4.9 Release Series – Changes, New Features, and Fixes by nly on Saturday April 12, 2014 @05:27PM (#7579276)
15 GB was presumably with LTO enabled, you could always build it on a fairly average laptop with it disabled. This is great news though, as LTO is pretty awesome.
Re:GCC 4.9 Release Series – Changes, New Features, and Fixes by hf on Saturday April 12, 2014 @05:52PM (#7579338)
For the uninitiated: LTO stands for Link-time optimization and happens when the compiler merges/links all separately-compiled object files into one (executable or library).

Although it seems obvious that this might be a good idea, why would it

1) use exorbitant amounts of memory; and

2) be "pretty awesome" instead of, say, mildly useful?

edit: And both questions satisfactorily answered in the time it took me to peruse the preamble of https://en.wikipedia.org/wiki/Interprocedural_optimization

Thank you!

Re:GCC 4.9 Release Series – Changes, New Features, and Fixes by dietrichepp on Saturday April 12, 2014 @06:06PM (#7579382)
LTO, as the name implies, means that you do another optimization pass at link time. This enables lots of optimizations that don't work when you look at one module at a time.

Functions can be inlined across module boundaries, even when they're not declared inline. You can turn virtual functions into regular functions, if you know that the virtual function is never overridden, or if you can derive the exact type. You can change calling conventions for functions. You can do better escape and aliasing analysis. If a function is only called once, then you can probably optimize it a lot better because you know exactly how it will be called.

As with all optimizations, not all programs will see any significant benefit. Programs with heavy inner loops like physics simulators and graphics processors will not see much benefit, since the local optimizer works well enough. Programs like compilers, interpreters, and web browsers will see larger benefits. However, the benefits can be high—30% improvements in running time are not unheard of.

In short, LTO is a high-cost, high-benefit optimization.

Re:GCC 4.9 Release Series – Changes, New Features, and Fixes by mattgrice on Saturday April 12, 2014 @06:03PM (#7579371)
Link-time optimization is not a very descriptive term. It's usually called whole-program or interprocedural optimization. Link-time optimization is just how it has been implemented.

It uses a lot of memory because it requires keeping a representation of more or less the entire program in memory at one time, in a format which is amenable to analysis. It is not out of the ordinary for an optimizer's internal representation to be on the order of 1000x the size of the source code.

Re:GCC 4.9 Release Series – Changes, New Features, and Fixes by anaphor on Sunday April 13, 2014 @06:49AM (#7580931)
For an example of a compiler other than GCC that does whole-program optimization see the Stalin Scheme compiler: https://github.com/barak/stalin
Re:GCC 4.9 Release Series – Changes, New Features, and Fixes by frozenport on Saturday April 12, 2014 @07:36PM (#7579599)
As a Gentoo user, we always did it on our laptop. Build time was about 30 minutes.
Re:GCC 4.9 Release Series – Changes, New Features, and Fixes by bgirard on Sunday April 13, 2014 @01:33AM (#7580351)
Firefox recently (Trunk as of December) started using Unified Sources so builds are now typically 7-9 minutes on laptops now for non Windows platforms.
Re:GCC 4.9 Release Series – Changes, New Features, and Fixes by supergauntlet on Saturday April 12, 2014 @04:23PM (#7579049)
well, you could do it on a laptop before, you just needed a much beefier laptop. But that's really impressive, how did they cut the resource usage to a quarter of previous usage?
Re:GCC 4.9 Release Series – Changes, New Features, and Fixes by alok-g on Saturday April 12, 2014 @04:34PM (#7579085)
I am very curious too. Such drastic improvements often indicates something wrong before (either in design or implementation) that got fixed.
Re:GCC 4.9 Release Series – Changes, New Features, and Fixes by Denvercoder9 on Saturday April 12, 2014 @06:09PM (#7579389)
I bet it is caused by these two optimizations:

> Early removal of virtual methods reduces the size of object files and improves link-time memory usage and compile time.

> Function bodies are now loaded on-demand and released early improving overall memory usage at link time.

Re:GCC 4.9 Release Series – Changes, New Features, and Fixes by _stephan on Saturday April 12, 2014 @04:17PM (#7579031)
GCC 4.9 hasn't yet been released (and won't be until after Easter). Currently there's only a release candidate. See http://permalink.gmane.org/gmane.comp.gcc.devel/135470
Re:GCC 4.9 Release Series – Changes, New Features, and Fixes by beatbrokedown on Saturday April 12, 2014 @04:32PM (#7579078)
Interesting the main page http://gcc.gnu.org/ lists 4.9 as the current release as opposed to Development release.
Re:GCC 4.9 Release Series – Changes, New Features, and Fixes by pygy_ on Saturday April 12, 2014 @04:58PM (#7579168)
If you follow the 4.9 link, you get to http://gcc.gnu.org/gcc-4.9/ which states:

> As of this time no releases of GCC 4.9 have yet been made.

Re:GCC 4.9 Release Series – Changes, New Features, and Fixes by jevinskie on Saturday April 12, 2014 @04:01PM (#7578982)
libstdc++ finally supports C++11's <regex>! My team will be able to ditch boost regex once GCC 4.9 hits a stable version of Ubuntu.

It is also nice to see more parity with Clang when it comes to diagnostics and ASan/UBSan.

Re:GCC 4.9 Release Series – Changes, New Features, and Fixes by nly on Saturday April 12, 2014 @05:18PM (#7579250)
Still not a fully optimised DFA solution though (although neither is Boost.Regex afaik)
Re:GCC 4.9 Release Series – Changes, New Features, and Fixes by _pmf_ on Saturday April 12, 2014 @04:05PM (#7578995)
Seems like competition from clang led to some really practical improvements.
Re:GCC 4.9 Release Series – Changes, New Features, and Fixes by dfc on Saturday April 12, 2014 @04:39PM (#7579107)
I use whatever compiler is defined in the makefile or called for in a README. Needless to say I do not really follow developments in either camp closely. I am curious what improvements are the result of "competition" from clang?
Re:GCC 4.9 Release Series – Changes, New Features, and Fixes by nly on Saturday April 12, 2014 @05:31PM (#7579286)
I might be doing GCC a disservice but I'm pretty sure the various sanitization work has come from LLVM/Clang.
Re:GCC 4.9 Release Series – Changes, New Features, and Fixes by gillianseed on Saturday April 12, 2014 @10:06PM (#7579899)
Actually the sanitizers where added to LLVM by Google who also added them to GCC as they are actively working on both compiler toolchains.
Re:GCC 4.9 Release Series – Changes, New Features, and Fixes by shurcooL on Sunday April 13, 2014 @04:39AM (#7580704)
Did anyone notice "GCC 4.9 provides a complete implementation of the Go 1.2.1 release."? Isn't that pretty big.
Re:GCC 4.9 Release Series – Changes, New Features, and Fixes by knweiss on Sunday April 13, 2014 @04:00AM (#7580639)
Support for the CPU code names in -march is a simple but really useful change:

   -march=nehalem, westmere, sandybridge, ivybridge, haswell,
   bonnell, broadwell, silvermont
Also this:

   -mtune=intel can now be used to generate code running well
   on the most current Intel processors, which are Haswell
   and Silvermont for GCC 4.9.
Re:GCC 4.9 Release Series – Changes, New Features, and Fixes by asveikau on Saturday April 12, 2014 @06:14PM (#7579406)
> A new C extension __auto_type provides a subset of the functionality of C++11 auto in GNU C.

I wonder if anyone is working to standardize something like this? It would be way more useful than all those _s() functions they added to C11.

Re:GCC 4.9 Release Series – Changes, New Features, and Fixes by PySlice on Sunday April 13, 2014 @12:32AM (#7580237)
Yes, bounds checking are unnecessary, you don't need those _s() functions - NSA director
Re:GCC 4.9 Release Series – Changes, New Features, and Fixes by asveikau on Sunday April 13, 2014 @10:11PM (#7584159)
The problem isn't bounds-checking, the problem is that most of the _s() functions that deal with bounds-checking already have pre-C11 equivalents that check boundaries.

I also disagree with some of the interface choices, for example when strlcpy() fails it tells you how many characters you needed, not simply "error" as in strcpy_s. Also the use case for memcpy_s() is extremely limited. It just seems like the _s() functions were rushed and stuck in there without regard for what makes sense.

Re:GCC 4.9 Release Series – Changes, New Features, and Fixes by dfc on Saturday April 12, 2014 @04:44PM (#7579123)
I wish latex/lualatex/xelatex would colorize their logs.
Re:GCC 4.9 Release Series – Changes, New Features, and Fixes by michaelhoffman on Saturday April 12, 2014 @04:50PM (#7579146)
I wish LaTeX would just limit their logs to information I need to see.
Re:GCC 4.9 Release Series – Changes, New Features, and Fixes by jonalmeida on Saturday April 12, 2014 @04:21PM (#7579046)
I like the addition of color the compile log. It's might be easier reading compile failures now.
Re:GCC 4.9 Release Series – Changes, New Features, and Fixes by jey on Saturday April 12, 2014 @04:05PM (#7578991)
Only six months since 4.8 was released. Is GCC moving to a more regular release schedule?
Re:GCC 4.9 Release Series – Changes, New Features, and Fixes by agwa on Saturday April 12, 2014 @06:48PM (#7579498)
4.8.0 was actually released in March 2013. GCC has been on a yearly major release schedule for several years now (since at least GCC 4.5.0 in 2010). This year 4.9.0 will be about a month late.
Re:GCC 4.9 Release Series – Changes, New Features, and Fixes by 0x09 on Saturday April 12, 2014 @04:20PM (#7579040)
That was a point release. 4.8.0 was released over a year ago.
Re:GCC 4.9 Release Series – Changes, New Features, and Fixes by nly on Saturday April 12, 2014 @04:17PM (#7579032)
What's wrong with every every 6 months? It's not like bug fix releases aren't dropped in the meantime.
Re:GCC 4.9 Release Series – Changes, New Features, and Fixes by mpyne on Saturday April 12, 2014 @04:20PM (#7579038)
I think that was the point... every 6 months being better than every 6+dx months as seemed the case before.

I don't personally notice a change though, IMHO releases have been fairly consistently released since the 4.0 timeframe.