[Bug c/39394] gcc 4.4.0 20090306 segfaults at argp-help.c in glibc 2.7 and 2.9

2009-03-09 Thread cneil at yahoo dot com


--- Comment #2 from cneil at yahoo dot com  2009-03-09 09:58 ---
I think I'm hitting the same bug as the reporter.

i686-pc-linux-gnu-gcc argp-help.c -c -std=gnu99 -fgnu89-inline -O2 -Wall
-Winline -Wwrite-strings -fmerge-all-constants -fno-strict-aliasing -ggdb
-march=i686 -pipe -Wstrict-prototypes -mpreferred-stack-boundary=2  -g0 -O99
-fomit-frame-pointer -D__USE_STRING_INLINES -fexceptions
-mpreferred-stack-boundary=4 -fexceptions   -I../include
-I/var/tmp/portage/sys-libs/glibc-2.9_p20081201-r2/work/build-default-i686-pc-linux-gnu-nptl/argp
-I/var/tmp/portage/sys-libs/glibc-2.9_p20081201-r2/work/build-default-i686-pc-linux-gnu-nptl
-I../sysdeps/i386/elf -I../nptl/sysdeps/unix/sysv/linux/i386/i686
-I../nptl/sysdeps/unix/sysv/linux/i386 -I../sysdeps/unix/sysv/linux/i386
-I../nptl/sysdeps/unix/sysv/linux -I../nptl/sysdeps/pthread
-I../sysdeps/pthread -I../ports/sysdeps/unix/sysv/linux
-I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common
-I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../ports/sysdeps/unix/sysv/i386
-I../sysdeps/unix/sysv/i386 -I../nptl/sysdeps/unix/sysv
-I../ports/sysdeps/unix/sysv-I../sysdeps/unix/sysv -I../sysdeps/unix/i386
-I../nptl/sysdeps/unix -I../ports/sysdeps/unix -I../sysdeps/unix
-I../sysdeps/posix -I../sysdeps/i386/i686/fpu -I../nptl/sysdeps/i386/i686
-I../sysdeps/i386/i686 -I../sysdeps/i386/i486 -I../nptl/sysdeps/i386/i486
-I../sysdeps/i386/fpu -I../nptl/sysdeps/i386 -I../sysdeps/i386
-I../sysdeps/wordsize-32 -I../sysdeps/ieee754/ldbl-96
-I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754
-I../sysdeps/generic/elf -I../sysdeps/generic -I../nptl -I../ports  -I..
-I../libio -I. -nostdinc -isystem
/usr/lib/gcc/i686-pc-linux-gnu/4.4.0-alpha20090306/include -isystem
/usr/lib/gcc/i686-pc-linux-gnu/4.4.0-alpha20090306/include-fixed -isystem
/usr/include -D_LIBC_REENTRANT -include ../include/libc-symbols.h  
-U_FORTIFY_SOURCE -U_FORTIFY_SOURCE -o
/var/tmp/portage/sys-libs/glibc-2.9_p20081201-r2/work/build-default-i686-pc-linux-gnu-nptl/argp/argp-help.o
-MD -MP -MF
/var/tmp/portage/sys-libs/glibc-2.9_p20081201-r2/work/build-default-i686-pc-linux-gnu-nptl/argp/argp-help.o.dt
-MT
/var/tmp/portage/sys-libs/glibc-2.9_p20081201-r2/work/build-default-i686-pc-linux-gnu-nptl/argp/argp-help.o
argp-help.c: In function #8216;print_header#8217;:
argp-help.c:1024: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See http://bugs.gentoo.org/ for instructions.

This is from a gentoo ebuild, but no patches are being applied.  I'm using the
gcc-4.4 snapshot from 20090306, and argp-help.c is from a glibc-2.9 snapshot
from 20091201.

I used -save-temps to get a preprocessed file (I'll attach momentarily) and did
a little trial-and-error experimenting.  Here's what I found:

gcc -c argp-help.i -o argp-help.o -O0 : succeeds
gcc -c argp-help.i -o argp-help.o -O1 : fails
gcc -c argp-help.i -o argp-help.o -O1 -fno-inline : succeeds

This is on an i686 (athlon-xp) machine, but I get the same failure on my x86_64
(amdfam10) machine.

Here's my output from gcc -v (on the athlon-xp machine):
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-4.4.0_alpha20090306/work/gcc-4.4-20090306/configure
--prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.4.0-alpha20090306
--includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.4.0-alpha20090306/include
--datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.4.0-alpha20090306
--mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.4.0-alpha20090306/man
--infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.4.0-alpha20090306/info
--with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.4.0-alpha20090306/include/g++-v4
--host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec
--disable-fixed-point --enable-nls --without-included-gettext
--with-system-zlib --disable-checking --disable-werror --enable-secureplt
--disable-multilib --enable-libmudflap --disable-libssp --enable-libgomp
--enable-cld --enable-java-awt=gtk --with-arch=i686 --enable-objc-gc
--enable-languages=c,c++,java,objc,obj-c++,fortran --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
--with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo
4.4.0_alpha20090306' --without-ppl --without-cloog --disable-ppl-version-check
--disable-cloog-version-check
Thread model: posix
gcc version 4.4.0-alpha20090306  (experimental) (Gentoo 4.4.0_alpha20090306)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39394



[Bug c/39394] gcc 4.4.0 20090306 segfaults at argp-help.c in glibc 2.7 and 2.9

2009-03-09 Thread cneil at yahoo dot com


--- Comment #3 from cneil at yahoo dot com  2009-03-09 10:00 ---
Created an attachment (id=17427)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17427action=view)
preprocessed argp-help.c

If any additional information is needed, I'll do my best to provide it.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39394



[Bug c/39394] gcc 4.4.0 20090306 segfaults at argp-help.c in glibc 2.7 and 2.9

2009-03-09 Thread cneil at yahoo dot com


--- Comment #4 from cneil at yahoo dot com  2009-03-09 10:14 ---
OK, maybe I should slept before I submitted this.

1.  The glibc-2.9 snapshot is from 20081201.  I am not capable of time travel.

2.  I successfully compiled this same glibc-2.9 snapshot with the gcc-4.4
snapshot from 20090220.  Hopefully this helps.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39394



[Bug c/39394] gcc 4.4.0 20090306 segfaults at argp-help.c in glibc 2.7 and 2.9

2009-03-09 Thread jakub at gcc dot gnu dot org


--- Comment #6 from jakub at gcc dot gnu dot org  2009-03-09 11:09 ---
Confirmed.  Simplified testcase:
extern inline void *
asmfn (void *dest, const void *src, unsigned long n)
{
  asm volatile (
: =m (*(struct { char x[n]; } *) dest)
: r (n), r (dest), r (src),
  m (*(struct { char x[n]; } *) src)
: cc);
  return dest;
}


extern inline void
baz (char *dest, const char *str, unsigned long len)
{
   if (__builtin_constant_p (len))
 asmfn (dest, str, len + 1);
   else
 asmfn (dest, str, len);
}

extern inline void
bar (char *dest, const char *str)
{
  baz (dest, str, __builtin_strlen (str));
}

void
foo (char *dest, const char *str)
{
  bar (dest, str);
}


-- 

jakub at gcc dot gnu dot org changed:

   What|Removed |Added

  Component|tree-optimization   |c
   Keywords|ice-on-valid-code   |
  Known to fail|4.4.0   |
  Known to work|4.3.1   |
   Priority|P3  |P1
   Last reconfirmed|-00-00 00:00:00 |2009-03-09 11:09:57
   date||
Summary|[4.4 regression] ICE in |gcc 4.4.0 20090306 segfaults
   |copy_tree_body_r|at argp-help.c in glibc 2.7
   ||and 2.9
   Target Milestone|--- |4.4.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39394



[Bug c/39394] gcc 4.4.0 20090306 segfaults at argp-help.c in glibc 2.7 and 2.9

2009-03-08 Thread kdebugs at hotmail dot com


--- Comment #1 from kdebugs at hotmail dot com  2009-03-08 09:18 ---
I don't know if these lines (from my memory) might be useful:

In fuction 'print_header'
argp-help.c:1024


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39394