public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/45647]  New: compiler segfault when building coreutils-8.5 "head" program with -Os, -O2 or -O3
@ 2010-09-11  9:56 nemykal at mercurylampe dot org
  2010-09-11 10:03 ` [Bug c/45647] " nemykal at mercurylampe dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: nemykal at mercurylampe dot org @ 2010-09-11  9:56 UTC (permalink / raw)
  To: gcc-bugs

Be nice, this is my first attempt at filing a bug report ever :)

gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/bin/../libexec/gcc/x86_64-pc-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ./configure --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--prefix=/home/suigintou/usr --enable-lto --with-mpfr=/home/suigintou/usr
--with-gmp=/home/suigintou/usr --with-mpc=/home/suigintou/usr
--with-ppl=/home/suigintou/usr --with-cloog=/home/suigintou/usr
--with-libelf=/home/suigintou/usr --enable-__cxa_atexit --enable-threads=posix
--enable-languages=c,c++ --disable-libstdcxx-pch --disable-bootstrap
--enable-clocale=gnu --disable-multilib
Thread model: posix
gcc version 4.6.0 20100824 (experimental) (GCC)



In coreutils-8.5/src, I type "make head", but this happens:

  CC       head.o
head.c: In function 'string_to_integer':
head.c:870:1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make: *** [head.o] Error 1



Verbose...

make head V=2
/home/suigintou/bin/gcc -B /home/suigintou/lib -L/home/suigintou/lib  -I
/home/suigintou/include -I /home/suigintou/usr/include -std=gnu99  -I. -I../lib
 -I../lib    -pipe -U_FORTIFY_SOURCE -fno-stack-protector -Os -march=native
-msse -msse2 -msse3 -msse4 -msse4.1 -msse4.2 -mssse3 -mtune=core2
-fomit-frame-pointer -funroll-loops -floop-interchange -floop-strip-mine
-floop-block -floop-parallelize-all -ftree-parallelize-loops=4 -MT head.o -MD
-MP -MF .deps/head.Tpo -c -o head.o head.c
head.c: In function 'string_to_integer':


I was experimenting with graphite and other optimizations. Silly CFLAGS
settings aside, I narrowed the cause down to that "-Os" flag. Gets the same
problem if I use -O2 or -O3, but not if I use -O1 or -O0.


-- 
           Summary: compiler segfault when building coreutils-8.5 "head"
                    program with -Os, -O2 or -O3
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: nemykal at mercurylampe dot org
 GCC build triplet: x86_64-pc-linux-gnu
  GCC host triplet: x86_64-pc-linux-gnu
GCC target triplet: x86_64-pc-linux-gnu


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c/45647] compiler segfault when building coreutils-8.5 "head" program with -Os, -O2 or -O3
  2010-09-11  9:56 [Bug c/45647] New: compiler segfault when building coreutils-8.5 "head" program with -Os, -O2 or -O3 nemykal at mercurylampe dot org
@ 2010-09-11 10:03 ` nemykal at mercurylampe dot org
  2010-09-11 10:51 ` rguenth at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: nemykal at mercurylampe dot org @ 2010-09-11 10:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from nemykal at mercurylampe dot org  2010-09-11 10:02 -------
I'm unsure exactly how to get the preprocessed output required... 

I ran:

"/home/suigintou/bin/gcc -B /home/suigintou/lib -L/home/suigintou/lib  -I
/home/suigintou/include -I /home/suigintou/usr/include -std=gnu99  -I. -I../lib
 -I../lib    -pipe -U_FORTIFY_SOURCE -fno-stack-protector -Os -march=native
-msse -msse2 -msse3 -msse4 -msse4.1 -msse4.2 -mssse3 -mtune=core2
-fomit-frame-pointer -funroll-loops -floop-interchange -floop-strip-mine
-floop-block -floop-parallelize-all -ftree-parallelize-loops=4 -MT head.o -MD
-MP -MF .deps/head.Tpo -c -o head.o head.c -save-temps -v"

and got this output:

gcc: warning: -pipe ignored because -save-temps specified
Using built-in specs.
COLLECT_GCC=/home/suigintou/bin/gcc
COLLECT_LTO_WRAPPER=/usr/bin/../libexec/gcc/x86_64-pc-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ./configure --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--prefix=/home/suigintou/usr --enable-lto --with-mpfr=/home/suigintou/usr
--with-gmp=/home/suigintou/usr --with-mpc=/home/suigintou/usr
--with-ppl=/home/suigintou/usr --with-cloog=/home/suigintou/usr
--with-libelf=/home/suigintou/usr --enable-__cxa_atexit --enable-threads=posix
--enable-languages=c,c++ --disable-libstdcxx-pch --disable-bootstrap
--enable-clocale=gnu --disable-multilib
Thread model: posix
gcc version 4.6.0 20100824 (experimental) (GCC)
COLLECT_GCC_OPTIONS='-B' '/home/suigintou/lib' '-L/home/suigintou/lib' '-I'
'/home/suigintou/include' '-I' '/home/suigintou/usr/include' '-std=gnu99' '-I.'
'-I../lib' '-I../lib' '-pipe' '-U_FORTIFY_SOURCE' '-fno-stack-protector' '-Os' 
'-msse' '-msse2' '-msse3' '-msse4' '-msse4.1' '-msse4.2' '-mssse3'
'-mtune=core2' '-fomit-frame-pointer' '-funroll-loops' '-floop-interchange'
'-floop-strip-mine' '-floop-block' '-floop-parallelize-all'
'-ftree-parallelize-loops=4' '-MT' 'head.o' '-MD' '-MP' '-MF' '.deps/head.Tpo'
'-c' '-o' 'head.o' '-save-temps' '-v' '-pthread'
 /usr/bin/../libexec/gcc/x86_64-pc-linux-gnu/4.6.0/cc1 -E -quiet -v -I
/home/suigintou/include -I /home/suigintou/usr/include -I. -I../lib -I../lib
-iprefix /usr/bin/../lib/gcc/x86_64-pc-linux-gnu/4.6.0/ -MD head.d -MF
.deps/head.Tpo -MP -MT head.o -D_REENTRANT -U_FORTIFY_SOURCE head.c
-march=core2 -mcx16 -msahf -mpopcnt -msse4.2 -msse -msse2 -msse3 -msse4
-msse4.1 -msse4.2 -mssse3 -mtune=core2 -std=gnu99 -fno-stack-protector
-fomit-frame-pointer -funroll-loops -floop-interchange -floop-strip-mine
-floop-block -floop-parallelize-all -ftree-parallelize-loops=4 -Os
-fpch-preprocess -o head.i
ignoring nonexistent directory
"/usr/bin/../lib/gcc/x86_64-pc-linux-gnu/4.6.0/../../../../x86_64-pc-linux-gnu/include"
ignoring duplicate directory
"/usr/bin/../lib/gcc/../../lib/gcc/x86_64-pc-linux-gnu/4.6.0/include"
ignoring duplicate directory
"/usr/bin/../lib/gcc/../../lib/gcc/x86_64-pc-linux-gnu/4.6.0/include-fixed"
ignoring nonexistent directory
"/usr/bin/../lib/gcc/../../lib/gcc/x86_64-pc-linux-gnu/4.6.0/../../../../x86_64-pc-linux-gnu/include"
ignoring duplicate directory "/usr/include"
ignoring duplicate directory "/home/suigintou/include"
  as it is a non-system directory that duplicates a system directory
ignoring duplicate directory "/home/suigintou/usr/include"
  as it is a non-system directory that duplicates a system directory
ignoring duplicate directory "../lib"
#include "..." search starts here:
#include <...> search starts here:
 .
 ../lib
 /usr/bin/../lib/gcc/x86_64-pc-linux-gnu/4.6.0/include
 /usr/bin/../lib/gcc/x86_64-pc-linux-gnu/4.6.0/include-fixed
 /usr/local/include
 /usr/bin/../lib/gcc/../../include
End of search list.
COLLECT_GCC_OPTIONS='-B' '/home/suigintou/lib' '-L/home/suigintou/lib' '-I'
'/home/suigintou/include' '-I' '/home/suigintou/usr/include' '-std=gnu99' '-I.'
'-I../lib' '-I../lib' '-pipe' '-U_FORTIFY_SOURCE' '-fno-stack-protector' '-Os' 
'-msse' '-msse2' '-msse3' '-msse4' '-msse4.1' '-msse4.2' '-mssse3'
'-mtune=core2' '-fomit-frame-pointer' '-funroll-loops' '-floop-interchange'
'-floop-strip-mine' '-floop-block' '-floop-parallelize-all'
'-ftree-parallelize-loops=4' '-MT' 'head.o' '-MD' '-MP' '-MF' '.deps/head.Tpo'
'-c' '-o' 'head.o' '-save-temps' '-v' '-pthread'
 /usr/bin/../libexec/gcc/x86_64-pc-linux-gnu/4.6.0/cc1 -fpreprocessed head.i
-march=core2 -mcx16 -msahf -mpopcnt -msse4.2 -quiet -dumpbase head.c -msse
-msse2 -msse3 -msse4 -msse4.1 -msse4.2 -mssse3 -mtune=core2 -auxbase-strip
head.o -Os -std=gnu99 -version -fno-stack-protector -fomit-frame-pointer
-funroll-loops -floop-interchange -floop-strip-mine -floop-block
-floop-parallelize-all -ftree-parallelize-loops=4 -o head.s
GNU C (GCC) version 4.6.0 20100824 (experimental) (x86_64-pc-linux-gnu)
        compiled by GNU C version 4.5.1, GMP version 4.3.2, MPFR version
3.0.0-p4, MPC version 0.8.2
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU C (GCC) version 4.6.0 20100824 (experimental) (x86_64-pc-linux-gnu)
        compiled by GNU C version 4.5.1, GMP version 4.3.2, MPFR version
3.0.0-p4, MPC version 0.8.2
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 6fec6b818ac315d511f9303bd7ae32f3
head.c: In function 'string_to_integer':
head.c:870:1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


and in head.i:
http://dpaste.org/RESS/


-- 

nemykal at mercurylampe dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nemykal at mercurylampe dot
                   |                            |org


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c/45647] compiler segfault when building coreutils-8.5 "head" program with -Os, -O2 or -O3
  2010-09-11  9:56 [Bug c/45647] New: compiler segfault when building coreutils-8.5 "head" program with -Os, -O2 or -O3 nemykal at mercurylampe dot org
  2010-09-11 10:03 ` [Bug c/45647] " nemykal at mercurylampe dot org
@ 2010-09-11 10:51 ` rguenth at gcc dot gnu dot org
  2010-09-11 12:23 ` nemykal at mercurylampe dot org
  2010-09-11 13:41 ` hjl dot tools at gmail dot com
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-09-11 10:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2010-09-11 10:51 -------
Please attach head.i here, pastes usually vanish after some time.


-- 


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c/45647] compiler segfault when building coreutils-8.5 "head" program with -Os, -O2 or -O3
  2010-09-11  9:56 [Bug c/45647] New: compiler segfault when building coreutils-8.5 "head" program with -Os, -O2 or -O3 nemykal at mercurylampe dot org
  2010-09-11 10:03 ` [Bug c/45647] " nemykal at mercurylampe dot org
  2010-09-11 10:51 ` rguenth at gcc dot gnu dot org
@ 2010-09-11 12:23 ` nemykal at mercurylampe dot org
  2010-09-11 13:41 ` hjl dot tools at gmail dot com
  3 siblings, 0 replies; 5+ messages in thread
From: nemykal at mercurylampe dot org @ 2010-09-11 12:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from nemykal at mercurylampe dot org  2010-09-11 12:23 -------
Created an attachment (id=21775)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21775&action=view)
Coreutils 8.5 head.c preprocessed into head.i

attached head.i for reference


-- 


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c/45647] compiler segfault when building coreutils-8.5 "head" program with -Os, -O2 or -O3
  2010-09-11  9:56 [Bug c/45647] New: compiler segfault when building coreutils-8.5 "head" program with -Os, -O2 or -O3 nemykal at mercurylampe dot org
                   ` (2 preceding siblings ...)
  2010-09-11 12:23 ` nemykal at mercurylampe dot org
@ 2010-09-11 13:41 ` hjl dot tools at gmail dot com
  3 siblings, 0 replies; 5+ messages in thread
From: hjl dot tools at gmail dot com @ 2010-09-11 13:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from hjl dot tools at gmail dot com  2010-09-11 13:41 -------
It has been fixed at least since revision 163804.


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.6.0


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-09-11 13:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-11  9:56 [Bug c/45647] New: compiler segfault when building coreutils-8.5 "head" program with -Os, -O2 or -O3 nemykal at mercurylampe dot org
2010-09-11 10:03 ` [Bug c/45647] " nemykal at mercurylampe dot org
2010-09-11 10:51 ` rguenth at gcc dot gnu dot org
2010-09-11 12:23 ` nemykal at mercurylampe dot org
2010-09-11 13:41 ` hjl dot tools at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).