[Bug c/28202] New: ARM cross-compiler seg. fault with -mfpu=vfp and optimization

clifford dot slocombe at dyson dot com gcc-bugzilla@gcc.gnu.org
Thu Jun 29 16:07:00 GMT 2006


Version info:
------------------
E:\vfpfault>arm-elf-gcc -v
Using built-in specs.
Target: arm-elf
Configured with: ../../gcc-4.0.2/configure --enable-languages=c,c++
--enable-interwork --enable-multilib --with-gcc --with-gnu-ld --with-gnu-as
--with-stabs --disable-shared --disable-threads --disable-win32-registry
--disable-nls --target=arm-elf --with-newlib --prefix=c:/WinARM -v
Thread model: single
gcc version 4.0.2 (WinARM)
------------------

Compile log:
------------------
E:\vfpfault>arm-elf-gcc -c -O2 -mfpu=vfp -mfloat-abi=softfp test.c
test.c: In function 'test':
test.c:4: 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.
------------------

Code to reproduce error (test.c)
------------------
double test( double x )           // Line 1
{                                 // Line 2
  return (x >= 0 ? 0 : -1.0);     // Line 3
}                                 // Line 4 - error reproted here.

-EOF--------------

I originally encountered this bug in code written to evaluate the performance
of the Philips LPC3180 microcontroller (which has VFP hardware) and GCC. The
error went away when I modified the code. I then encountered it again when
attempting to rebuild Newlib-1.14.0 for VFP support, where it occurred in
mathfp/s_floor.c. The code presented here is derived from the newlib code by
cutting it down to the smallest code possible that reproduces the error and
with no dependencies.

The error occurs also when line 3 is replaced with the following:

return( x >= 0 ) ;
return( x <= 0 ) ;
return( x > 0 ) ;
return( x < 0 ) ;

Although in all four of the above, if the return type is changed to int, it
does not fail.

In all cases if -mfpu=vfp or the -Ox option is removed, the error does not
occur.

The error occurs for all of -Os, -O1, -O2, -O3, (but not -O0).

The test platform details for the test were:
Windows XP Pro SP2
HP Compaq nx8220 Laptop, Pentium M 2.0GHz, 1Gb RAM

Note that the compiler used was a native Win32 build and not a Cygwin dependant
or Linux hosted build.


-- 
           Summary: ARM cross-compiler seg. fault with -mfpu=vfp and
                    optimization
           Product: gcc
           Version: 4.0.2
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: clifford dot slocombe at dyson dot com


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



More information about the Gcc-bugs mailing list