Bugs/non-portable assumptions in libstdc++

Jason Merrill jason@redhat.com
Mon Nov 22 22:55:00 GMT 2004


On Fri, 19 Nov 2004 11:51:59 -0600 (CST), Chris Lattner <sabre@nondot.org> wrote:

> From my understanding of the standard, I don't think that this is a legal
> optimization to make.  You are assuming that unconstructed memory starts
> out zero initialized, which is not always the case.

It is the case for objects with static storage duration.

> If you're curious, this is breaking with llvmg++, because the optimizer
> keeps track of uninitialized memory and optimizes based off of that
> information.  In this case, it's seeing loads from uninitialized data, and
> just deletes them.

This is an invalid optimization for such objects.

Jason



More information about the Libstdc++ mailing list