On Linux/ia32, GCC 4.7.0 revision 171601 miscompiled glibc trunk. I got [hjl@gnu-6 glibc-32bit]$ GCONV_PATH=/export/build/gnu/glibc-32bit/build-i686-linux/iconvdata LC_ALL=C /export/build/gnu/glibc-32bit/build-i686-linux/elf/ld-linux.so.2 --library-path /export/build/gnu/glibc-32bit/build-i686-linux:/export/build/gnu/glibc-32bit/build-i686-linux/math:/export/build/gnu/glibc-32bit/build-i686-linux/elf:/export/build/gnu/glibc-32bit/build-i686-linux/dlfcn:/export/build/gnu/glibc-32bit/build-i686-linux/nss:/export/build/gnu/glibc-32bit/build-i686-linux/nis:/export/build/gnu/glibc-32bit/build-i686-linux/rt:/export/build/gnu/glibc-32bit/build-i686-linux/resolv:/export/build/gnu/glibc-32bit/build-i686-linux/crypt:/export/build/gnu/glibc-32bit/build-i686-linux/nptl /export/build/gnu/glibc-32bit/build-i686-linux/nptl/tst-cancel17 --direct going to cancel tf in-time Segmentation fault [hjl@gnu-6 glibc-32bit]$ GCONV_PATH=/export/build/gnu/glibc-32bit/build-i686-linux/iconvdata LC_ALL=C /export/build/gnu/glibc-32bit/build-i686-linux/elf/ld-linux.so.2 --library-path /export/build/gnu/glibc-32bit/build-i686-linux:/export/build/gnu/glibc-32bit/build-i686-linux/math:/export/build/gnu/glibc-32bit/build-i686-linux/elf:/export/build/gnu/glibc-32bit/build-i686-linux/dlfcn:/export/build/gnu/glibc-32bit/build-i686-linux/nss:/export/build/gnu/glibc-32bit/build-i686-linux/nis:/export/build/gnu/glibc-32bit/build-i686-linux/rt:/export/build/gnu/glibc-32bit/build-i686-linux/resolv:/export/build/gnu/glibc-32bit/build-i686-linux/crypt:/export/build/gnu/glibc-32bit/build-i686-linux/nptl /export/build/gnu/glibc-32bit/build-i686-linux/nptl/tst-cancelx17 --direct going to cancel tf in-time Segmentation fault [hjl@gnu-6 glibc-32bit]$
It is caused by revision 171450: http://gcc.gnu.org/ml/gcc-cvs/2011-03/msg00874.html
I used CC="gcc -m32" CXX="g++ -m32" CFLAGS="-O2 -g -march=i686" /export/gnu/import/git/glibc/configure --enable-add-ons=nptl --prefix=/usr --without-cvs --enable-multi-arch --enable-test-multi-arch --target=i686-linux --build=i686-linux --host=i686-linux --enable-kernel=2.6.35 to configure glibc on Linux/x86-64.
I'm guessing this is the recent RA changes in r171649.
(In reply to comment #3) > I'm guessing this is the recent RA changes in r171649. Oops, sorry; you already triaged it.
Testcase? (early FRE probably only triggers latent bugs)
Seems aio_suspend.c is problematic. Strangely, it segfaults even when aio_suspend.c is built with gcc 4.5 or 4.4, but with -O0 -D__OPTIMIZE__ instead of -O2, so it probably relies on some optimization that is no longer occurring after the FRE changes.
With gcc 4.6 built aio_suspend.os, it works even with -O0 or -O2 -fno-inline, if __pthread_cleanup_routine has __attribute__((always_inline)). With current trunk, even if that routine is inlined it crashes though.
This may be a glibc bug: http://sourceware.org/ml/libc-alpha/2011-08/msg00063.html
As discussed on the libc-alpha mailing list, this is a glibc bug.