From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16254 invoked by alias); 13 Jun 2008 12:59:28 -0000 Received: (qmail 10567 invoked by uid 48); 13 Jun 2008 12:58:41 -0000 Date: Fri, 13 Jun 2008 12:59:00 -0000 Subject: [Bug target/36527] New: gcc 4.2.x generates wrong code for ARM target X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "benny at ammitzboell-consult dot dk" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-06/txt/msg00838.txt.bz2 We have encountered what seems to be a gcc bug in the attempt to upgrade our toolchain (using buildroot, embedded ARM no-MMU CPU) from 3.4.6 to 4.2.x. The bug has been seen on both 4.2.3 and 4.2.4. We have not yet been able to build a toolchain based on gcc 4.3.1. Most of our +5 MB system runs fine, but some strange problems we had boiled down to the attached test programs which essentially deals with passing some int parms and a struct through two function calls. The test code fails when executed on the ARM target. It works on x86 using gcc 4.2.3 and also on a MIPS platform using gcc 4.2.1. The test code only fails with -O2. Compiled using: bla@bla-desktop:~/src/kuss/tmp$ /home/bla/src/kuss/bs/toolchain/linux24/usr/bin/arm-elf-gcc -save-temps -c -Wall -Werror -O2 -g -Wa,-W -o .o/arm4/test.o test.c bla@bla-desktop:~/src/kuss/tmp$ /home/bla/src/kuss/bs/toolchain/linux24/usr/bin/arm-elf-g++ -save-temps -c -Wall -Werror -O2 -g -Wa,-W -o .o/arm4/testcpp.o testcpp.cpp Output from the C test run on target: :/> /bin/test ### C test: Values before test: 1 2 3 4 ### FAILS: 0x00000001 0x00000002 0x00000004 0x00000004 ### OK Output from the C++ test run on target: :/> /bin/testcpp ### C++ test: Values before test: 1 2 3 4 ### FAILS: 0x00000001 0x00000002 0x00000004 0x00000004 ### OK bla@bla-desktop:~/src/kuss/tmp$ ../bs/toolchain/linux24/usr/bin/arm-elf-gcc -v Using built-in specs. Target: arm-linux-uclibc Configured with: /home/bla/src/kuss/opensrc/gpl/toolchains/arm-gcc4/toolchain_build_arm/gcc-4.2.4/configure --prefix=/usr --build=i386-pc-linux-gnu --host=i386-pc-linux-gnu --target=arm-linux-uclibc --enable-languages=c,c++ --with-sysroot=/home/bla/src/kuss/bs/toolchain/linux24 --with-build-time-tools=/home/bla/src/kuss/bs/toolchain/linux24/usr/arm-linux-uclibc/bin --disable-__cxa_atexit --enable-target-optspace --with-gnu-ld --disable-libgomp --disable-libmudflap --disable-shared --with-gmp=/home/bla/src/kuss/opensrc/gpl/toolchains/arm-gcc4/toolchain_build_arm/gmp --with-mpfr=/home/bla/src/kuss/opensrc/gpl/toolchains/arm-gcc4/toolchain_build_arm/mpfr --disable-nls --enable-threads --disable-multilib --with-float=soft --with-arch=armv4 --with-tune=arm7tdmi Thread model: posix gcc version 4.2.4 -- Summary: gcc 4.2.x generates wrong code for ARM target Product: gcc Version: 4.2.4 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: benny at ammitzboell-consult dot dk GCC build triplet: i386-pc-linux-gnu GCC host triplet: i386-pc-linux-gnu GCC target triplet: arm-linux-uclibc http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36527