Richard Biener wrote: > On Wed, Jul 29, 2015 at 3:57 PM, Ulrich Weigand <uweig...@de.ibm.com> wrote: > > Hello, > > > > this patch is a workaround for the problem discussed here: > > https://gcc.gnu.org/ml/gcc-patches/2015-07/msg01597.html > > > > The problem is that the new pool allocator code relies on C++ aliasing > > rules related to placement new (basically, that placement new changes > > the dynamic type of the referenced memory). GCC compilers prior to > > version 4.3 did not implement this rule correctly (PR 29286). > > > > When building current GCC with a host compiler that is affected by this > > bug, and we build with optimization enabled (this typically only happens > > when building a cross-compiler), the resulting compiler binary may be > > miscompiled. > > > > The patch below attempts to detect this situation by checking whether > > the host compiler is a version of GCC prior to 4.3 (but stil accepts > > the -fno-strict-aliasing flag). If so, -fno-strict-aliasing is added > > to the flags when building the compiler binary. > > > > Tested on i686-linux, and when building an SPU cross-compiler using > > a gcc 4.1 powerpc64-linux host compiler. > > > > OK for mainline? > > Ok if nobody objects.
I've checked this in now. Thanks, Ulrich -- Dr. Ulrich Weigand GNU/Linux compilers and toolchain ulrich.weig...@de.ibm.com