From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30884 invoked by alias); 29 Jun 2006 16:03:38 -0000 Received: (qmail 30813 invoked by uid 48); 29 Jun 2006 16:03:30 -0000 Date: Thu, 29 Jun 2006 16:07:00 -0000 Subject: [Bug c/28202] New: ARM cross-compiler seg. fault with -mfpu=vfp and optimization X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "clifford dot slocombe at dyson dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-06/txt/msg02503.txt.bz2 List-Id: 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 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