This file:

void t(double foo)
{
    puts(foo <= 1.0 ?  "foo" : "bar");
}

provokes ICE segfault when compiled with

gcc -O -mfpu=maverick -mcpu=ep9312 -mhard-float -c t.c

Confirmed same behaviour in:
- native Debian "armel" gcc-4.1.3 arm-linux-gnueabi
- native Debian "arm" gcc-4.1.2 on arm-linux-gnu
- cross-compiler gcc-4.1.1 on i386-linux-gnu target arm-linux-gnueabi

The SEGV goes away if -msoft-float is used instead of -mhard-float;
removing -O also makes the compilation succeed.

Strangely, explicitly supplying the -f flags that -O is said to enable:
-fdefer-pop -fdelayed-branch -fguess-branch-probability -fcprop-registers
-floop-optimize -fif-conversion -fif-conversion2 -ftree-ccp -ftree-dce
-ftree-dominator-opts -ftree-dse -ftree-ter -ftree-lrs -ftree-sra
-ftree-copyrename -ftree-fre -ftree-ch -funit-at-a-time -fmerge-constants
-fomit-frame-pointer
does not provoke the segfault, but adding -O to the the list does.

Here are the native gcc-4.1.3 details:

Target: arm-linux-gnueabi
Configured with: ../src/configure -v
--enable-languages=c,c++,fortran,obj-c++,treelang --prefix=/usr --enable-shared
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --enable-nls
--with-gxx-include-dir=/usr/include/c++/4.1.3 --program-suffix=-4.1
--enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug
--enable-mpfr --disable-libssp --enable-checking=release arm-linux-gnueabi
Thread model: posix
gcc version 4.1.3 20070812 (prerelease) (Debian 4.1.2-15)

Output:
t.c: In function 't':
t.c:4: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.


-- 
           Summary: ICE: SEGV compiling for -mcpu=ep9312 -mfpu-maverick -
                    mhard-float -O
           Product: gcc
           Version: 4.1.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: martinwguy at yahoo dot it
 GCC build triplet: arm-linux-gnueabi
  GCC host triplet: arm-linux-gnueabi
GCC target triplet: arm-linux-gnueabi


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

Reply via email to