Bug 48338 - [4.7 Regression] Glibc miscompiled
Summary: [4.7 Regression] Glibc miscompiled
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.7.0
: P3 normal
Target Milestone: 4.7.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-29 14:37 UTC by H.J. Lu
Modified: 2011-08-23 13:29 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2011-03-30 08:28:55


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2011-03-29 14:37:50 UTC
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]$
Comment 1 H.J. Lu 2011-03-29 22:35:08 UTC
It is caused by revision 171450:

http://gcc.gnu.org/ml/gcc-cvs/2011-03/msg00874.html
Comment 2 H.J. Lu 2011-03-29 22:36:52 UTC
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.
Comment 3 Hans-Peter Nilsson 2011-03-30 01:45:20 UTC
I'm guessing this is the recent RA changes in r171649.
Comment 4 Hans-Peter Nilsson 2011-03-30 01:48:45 UTC
(In reply to comment #3)
> I'm guessing this is the recent RA changes in r171649.

Oops, sorry; you already triaged it.
Comment 5 Richard Biener 2011-03-30 08:28:55 UTC
Testcase?  (early FRE probably only triggers latent bugs)
Comment 6 Jakub Jelinek 2011-04-13 10:37:54 UTC
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.
Comment 7 Jakub Jelinek 2011-04-13 11:06:48 UTC
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.
Comment 8 H.J. Lu 2011-08-19 14:34:33 UTC
This may be a glibc bug:

http://sourceware.org/ml/libc-alpha/2011-08/msg00063.html
Comment 9 Jakub Jelinek 2011-08-23 13:29:04 UTC
As discussed on the libc-alpha mailing list, this is a glibc bug.