[LLVMbugs] [Bug 5293] New: Miscompilation on ARM with C struct members
bugzilla-daemon at cs.uiuc.edu
bugzilla-daemon at cs.uiuc.edu
Fri Oct 23 19:42:54 PDT 2009
http://llvm.org/bugs/show_bug.cgi?id=5293
Summary: Miscompilation on ARM with C struct members
Product: libraries
Version: trunk
Platform: Other
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Backend: ARM
AssignedTo: unassignedbugs at nondot.org
ReportedBy: lessen42 at gmail.com
CC: llvmbugs at cs.uiuc.edu
The attached file (sorry it isn't smaller, the bug randomly disappears if the
elements are reduced or foo is changed) works perfectly on x86-64, and on ARM
at -O0. Enabling optimizations on ARM however, row_preds overlaps space,
resulting in space being overwritten.
Expected output:
before: 0xdeadbeef
after: 0xdeadbeef
Actual output:
before: 0xdeadbeef
after: 0x0
$ clang -ccc-host-triple arm-none-linux -ccc-gcc-name
arm-none-linux-gnueabi-gcc -isysroot=/usr/local/arm/arm-none-linux-gnueabi/libc
-O1 test.c -v
clang version 1.1 (trunk 84983)
Target: arm-none-linux
Thread model: posix
clang: warning: unknown platform, assuming -mfloat-abi=soft
"/usr/local/src/llvm/build/Release+Debug/bin/clang-cc" -triple
armv4t-none-linux -S -disable-free -main-file-name test.c --relocation-model
static --disable-fp-elim --unwind-tables=0 -target-abi aapcs-linux
-mcpu=arm7tdmi -soft-float -float-abi=soft --fmath-errno=1 -v
-isysroot=/usr/local/arm/arm-none-linux-gnueabi/libc -O1 -fexceptions=0
-fdiagnostics-show-option -o
/var/folders/WC/WCQfew6LEaqrFEF+j4W8CE+++TI/-Tmp-/cc-RUWytb.s -x c test.c
clang-cc version 1.1 based upon llvm 2.7svn hosted on x86_64-apple-darwin10
ignoring nonexistent directory
"/usr/local/arm/arm-none-linux-gnueabi/libc/usr/local/include"
ignoring nonexistent directory
"/usr/local/arm/arm-none-linux-gnueabi/libc/System/Library/Frameworks"
ignoring nonexistent directory
"/usr/local/arm/arm-none-linux-gnueabi/libc/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/src/llvm/build/Release+Debug/lib/clang/1.1/include
/usr/local/arm/arm-none-linux-gnueabi/libc/usr/include
End of search list.
"/usr/local/arm/bin/arm-none-linux-gnueabi-gcc"
-isysroot=/usr/local/arm/arm-none-linux-gnueabi/libc -O1 -v -c -o
/var/folders/WC/WCQfew6LEaqrFEF+j4W8CE+++TI/-Tmp-/cc-u8RHEO.o -x assembler
/var/folders/WC/WCQfew6LEaqrFEF+j4W8CE+++TI/-Tmp-/cc-RUWytb.s
Using built-in specs.
Target: arm-none-linux-gnueabi
Configured with: /usr/local/src/gcc-4.3/configure
--target=arm-none-linux-gnueabi --enable-threads --enable-languages=c
--with-sysroot=/usr/local/arm/arm-none-linux-gnueabi/libc
--prefix=/usr/local/gcc-2009q1
Thread model: posix
gcc version 4.3.3 (GCC)
COLLECT_GCC_OPTIONS='-isysroot=/usr/local/arm/arm-none-linux-gnueabi/libc'
'-O1' '-v' '-c' '-o'
'/var/folders/WC/WCQfew6LEaqrFEF+j4W8CE+++TI/-Tmp-/cc-u8RHEO.o'
/usr/local/arm/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/as
-meabi=5 -o /var/folders/WC/WCQfew6LEaqrFEF+j4W8CE+++TI/-Tmp-/cc-u8RHEO.o
/var/folders/WC/WCQfew6LEaqrFEF+j4W8CE+++TI/-Tmp-/cc-RUWytb.s
COMPILER_PATH=/usr/local/arm/bin/../libexec/gcc/arm-none-linux-gnueabi/4.3.3/:/usr/local/arm/bin/../libexec/gcc/:/usr/local/arm/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/
LIBRARY_PATH=/usr/local/arm/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/:/usr/local/arm/bin/../lib/gcc/:/usr/local/arm/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/lib/:/usr/local/arm/arm-none-linux-gnueabi/libc/lib/:/usr/local/arm/arm-none-linux-gnueabi/libc/usr/lib/
COLLECT_GCC_OPTIONS='-isysroot=/usr/local/arm/arm-none-linux-gnueabi/libc'
'-O1' '-v' '-c' '-o'
'/var/folders/WC/WCQfew6LEaqrFEF+j4W8CE+++TI/-Tmp-/cc-u8RHEO.o'
"/usr/local/arm/bin/arm-none-linux-gnueabi-gcc"
-isysroot=/usr/local/arm/arm-none-linux-gnueabi/libc -O1 -v -o a.out
/var/folders/WC/WCQfew6LEaqrFEF+j4W8CE+++TI/-Tmp-/cc-u8RHEO.o
Using built-in specs.
Target: arm-none-linux-gnueabi
Configured with: /usr/local/src/gcc-4.3/configure
--target=arm-none-linux-gnueabi --enable-threads --enable-languages=c
--with-sysroot=/usr/local/arm/arm-none-linux-gnueabi/libc
--prefix=/usr/local/gcc-2009q1
Thread model: posix
gcc version 4.3.3 (GCC)
COMPILER_PATH=/usr/local/arm/bin/../libexec/gcc/arm-none-linux-gnueabi/4.3.3/:/usr/local/arm/bin/../libexec/gcc/:/usr/local/arm/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/
LIBRARY_PATH=/usr/local/arm/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/:/usr/local/arm/bin/../lib/gcc/:/usr/local/arm/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/lib/:/usr/local/arm/arm-none-linux-gnueabi/libc/lib/:/usr/local/arm/arm-none-linux-gnueabi/libc/usr/lib/
COLLECT_GCC_OPTIONS='-isysroot=/usr/local/arm/arm-none-linux-gnueabi/libc'
'-O1' '-v' '-o' 'a.out'
/usr/local/arm/bin/../libexec/gcc/arm-none-linux-gnueabi/4.3.3/collect2
--sysroot=/usr/local/arm/arm-none-linux-gnueabi/libc --eh-frame-hdr
-dynamic-linker /lib/ld-linux.so.3 -X -m armelf_linux_eabi -o a.out
/usr/local/arm/arm-none-linux-gnueabi/libc/usr/lib/crt1.o
/usr/local/arm/arm-none-linux-gnueabi/libc/usr/lib/crti.o
/usr/local/arm/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/crtbegin.o
-L/usr/local/arm/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3
-L/usr/local/arm/bin/../lib/gcc
-L/usr/local/arm/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/lib
-L/usr/local/arm/arm-none-linux-gnueabi/libc/lib
-L/usr/local/arm/arm-none-linux-gnueabi/libc/usr/lib
/var/folders/WC/WCQfew6LEaqrFEF+j4W8CE+++TI/-Tmp-/cc-u8RHEO.o -lgcc --as-needed
-lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed
/usr/local/arm/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/crtend.o
/usr/local/arm/arm-none-linux-gnueabi/libc/usr/lib/crtn.o
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list