I use gcc-4.0.3, binutils-2.16.1, linux-libc-headers-2.6.12.0, glibc-2.3.6.
My building host is debian (gcc 3.3.5).

'arm-linux-gcc -v' outputs:
---------
Configured with: ../gcc-4.0.3/configure --target=arm-linux
--prefix=/my-install-path/tools
--with-sysroot=/my-install-path/sys-root-arm-linux
--with-headers=/my-install-path/sys-root-arm-linux/usr/include
--enable-languages=c --disable-threads --disable-shared --with-float=softfp
--with-fpu=vfp
---------

My simplified sources:
-- v.c --
double v(double f){
  if(f < 1.){
    f=-3.40282347e+38F;
  }else{
    f=3.0;
  }
  return f*.1;
}
---------

When I compile v.c, with:
'arm-linux-gcc -mfloat-abi=softfp -mfpu=vfp -O3 -c v.c'
I have this message:

---------
v.c: In function 'v':
v.c:9: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
---------


'arm-linux-gcc -mfloat-abi=softfp -mfpu=vfp -c v.c' is ok
'arm-linux-gcc -mfloat-abi=softfp -mfpu=vfp -O0 -c v.c' is ok
'arm-linux-gcc -mfloat-abi=softfp -mfpu=vfp -O1 -c v.c' fails
'arm-linux-gcc -mfloat-abi=softfp -mfpu=vfp -O2 -c v.c' fails
'arm-linux-gcc -mfloat-abi=softfp -mfpu=vfp -O3 -c v.c' fails

'arm-linux-gcc -mfloat-abi=softfp -mfpu=fpa -c v.c' is ok
'arm-linux-gcc -mfloat-abi=softfp -mfpu=fpa -O0 -c v.c' is ok
'-O1', '-O2', '-O3' are ok

'arm-linux-gcc -mfloat-abi=softfp -mfpu=maverick -c v.c' outputs
'/tmp/ccwfEXjq.s:11: Error: selected processor does not support <blah blah>' so
cc1 is ok
'-O1', '-O2', '-O3' writes the same kind of message.

'arm-linux-gcc -mfloat-abi=softfp -mfpu=fpe2 -c v.c' is ok
'-O1', '-O2', '-O3' are ok

'arm-linux-gcc -mfloat-abi=softfp -mfpu=fpe3 -c v.c' is ok
'-O1', '-O2', '-O3' are ok

'arm-linux-gcc -mfloat-abi=soft -mfpu=vfp -c v.c' is ok
'-O1', '-O2', '-O3' are ok

Note: with 'ok', I mean 'no error is returned by arm-linux-gcc'. I did not test
the resulting binaries.

Analyse:

arm-linux-gcc excutes cc1 with something like this:
'/path-to/cc1 -quiet v.c -dumpbase v.c -mfloat-abi=softfp -mfpu=vfp -auxbase v
-O1 -o /tmp/ccJycUj7.s'

cc1 SegFaults at line 3636 of 'optabs.c' in 'prepare_float_lib_cmp'.
This function is called from 'prepare_cmp_insn'.

In function 'prepare_cmp_insn', 'can_compare_p' returns false, so
'prepare_float_lib_cmp' is called. With the working cases,  'can_compare_p'
returns true. So I think it should returns true, but you should be faster than
me to figure out why it returns false in this case.


-- 
           Summary: ICE using -mfloat-abi=softfp -mfpu=vfp -O1
           Product: gcc
           Version: 4.0.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: vincent_galceran at yahoo dot com


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

Reply via email to