This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/17560] New: Segmentation fault compiling prdtoa.c with -Os


Gcc was built from cvs this morning, configured as follows:

../gcc/configure --prefix=/home/kherron/gcc --program-prefix=cvs- \
        --with-cpu=athlon --with-arch=athlon --enable-threads \
        --enable-languages='c,c++'

prdtoa.c is part of NSPR, which is part of mozilla. Compiling with this command:

/home/kherron/gcc/bin/cvs-gcc -o prdtoa.o -c -save-temps -ansi -Wall -pthread
-Os -ffast-math -g -fno-inline -fPIC  -UNDEBUG -DDEBUG_kherron 
-DMOZILLA_CLIENT=1 -DDEBUG=1 -DXP_UNIX=1 -D_POSIX_SOURCE=1 -D_BSD_SOURCE=1
-D_SVID_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -DHAVE_FCNTL_FILE_LOCKING=1 -DLINUX=1
-Di386=1 -DHAVE_LCHOWN=1 -DHAVE_STRERROR=1 -D_REENTRANT=1  -DFORCE_PR_LOG
-D_PR_PTHREADS -UHAVE_CVAR_BUILT_ON_SEM -D_NSPR_BUILD_
-I/extra/kherron/moz/gcc4/dist/include/nspr
-I/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/include
-I/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/include/private 
/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c

produces a segfault:

/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c: In function
'Balloc':
/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c:588: warning:
suggest parentheses around assignment used as truth value
/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c: In function 'mult':
/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c:883: warning:
suggest parentheses around assignment used as truth value
/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c:897: warning:
suggest parentheses around assignment used as truth value
/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c: In function
'pow5mult':
/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c:949: warning:
suggest parentheses around assignment used as truth value
/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c: In function
'lshift':
/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c:1030: warning:
suggest parentheses around assignment used as truth value
/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c: In function 'b2d':
/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c:1252: warning:
suggest parentheses around + or - inside shift
/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c:1254: warning:
suggest parentheses around + or - inside shift
/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c:1254: warning:
suggest parentheses around + or - inside shift
/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c:1259: warning:
suggest parentheses around + or - inside shift
/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c:1261: warning:
suggest parentheses around + or - inside shift
/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c: In function 'd2b':
/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c:1332: warning:
suggest parentheses around assignment used as truth value
/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c:1336: warning:
suggest parentheses around assignment used as truth value
/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c:1337: warning:
suggest parentheses around assignment used as truth value
/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c:1338: warning:
suggest parentheses around + or - inside shift
/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c: In function
'PR_strtod':
/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c:1904: warning:
suggest parentheses around assignment used as truth value
/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c:1964: warning:
suggest parentheses around assignment used as truth value
/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c:1983: warning:
suggest parentheses around + or - inside shift
/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c: In function
'nrv_alloc':
/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c:2647: warning:
suggest parentheses around assignment used as truth value
/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c: In function 'dtoa':
/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c:2827: warning:
suggest parentheses around assignment used as truth value
/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c:2871: warning:
suggest parentheses around + or - inside shift
/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c:2872: warning:
suggest parentheses around + or - inside shift
/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c:2872: warning:
suggest parentheses around + or - inside shift
/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c:2981: warning:
suggest parentheses around assignment used as truth value
/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c:3095: warning:
suggest parentheses around && within ||
/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c:3142: warning:
suggest parentheses around assignment used as truth value
/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c:3180: warning:
suggest parentheses around assignment used as truth value
/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c:3269: warning:
suggest parentheses around && within ||
/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c:3286: warning:
suggest parentheses around && within ||
/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c:3346: warning:
suggest parentheses around && within ||
/extra/kherron/moz/gcc4/../mozilla/nsprpub/pr/src/misc/prdtoa.c:3357: warning:
label 'trimzeros' defined but not used
cvs-gcc: Internal error: Segmentation fault (program cc1)
Please submit a full bug report.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

When I remove "-Os" from the command line, or change it to something else like
-O3, gcc compiles the file successfully.

-- 
           Summary: Segmentation fault compiling prdtoa.c with -Os
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kherron+gcc at fmailbox dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]