help with g++ and strict aliasing on x86-64

Ian Lance Taylor iant@google.com
Mon Nov 22 18:37:00 GMT 2010


Alberto Griggio <alberto.griggio@gmail.com> writes:

> My OS is Debian GNU/Linux 5.0, compiler is
> g++-4.1 (GCC) 4.1.3 20080704 (prerelease) (Debian 4.1.2-25)
> platform x86-64

>               head_ = new (mem) Link;

> If I uncomment the "may_alias" attribute, everything works.

There have been a few bugs in the handling of placement new with regard
to aliasing.  See in particular http://gcc.gnu.org/PR29286 .  As far as
I know these bugs are fixed in current releases but they are apparently
not fixed in the older release you are using.

Ian



More information about the Gcc-help mailing list