[llvm-commits] [llvm-gcc-4.2] r98626 - /llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp

Duncan Sands baldrick at free.fr
Tue Mar 16 13:10:57 PDT 2010


On 16/03/10 19:18, Chris Lattner wrote:
> On Mar 16, 2010, at 11:15 AM, Duncan Sands wrote:
>>> I originally tried to do this for llvm-gcc 3 and was defeated by libstdc++.  It assumes (and it turns out the c++ standard allows this) that global variables are zero initialized before the constructor for a type is run on it.
>>
>> That is so annoying!  You could do easily do some nice simplifications if this
>> wasn't the case...
>
> Yeah I know.  I assume you noticed the globalopt xforms that build on this.  I added those back when I thought that the c++ frontend could take advantage of it, then had to revert the frontend changes.

Actually those globalopt transforms are still useful - for Ada.  In Ada a global
variable without an explicit initializer is not implicitly zero-initialized, it
is simply uninitialized (undef).

Ciao,

Duncan.



More information about the llvm-commits mailing list