[LLVMbugs] [Bug 6348] New: wrong code bug in msp430 backend
bugzilla-daemon at cs.uiuc.edu
bugzilla-daemon at cs.uiuc.edu
Thu Feb 18 14:32:01 PST 2010
http://llvm.org/bugs/show_bug.cgi?id=6348
Summary: wrong code bug in msp430 backend
Product: new-bugs
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Keywords: miscompilation
Severity: normal
Priority: P2
Component: new bugs
AssignedTo: unassignedbugs at nondot.org
ReportedBy: pagariya at cs.utah.edu
CC: llvmbugs at cs.uiuc.edu, regehr at cs.utah.edu
Test case:
#include<stdint.h>
uint8_t g_15 = -1L;
uint32_t bar() {
g_15 = 1;
return 0xaa;
}
int main() {
uint16_t l_5 = 0x1234;
uint16_t l_14[2][2] = {{-1,-1}, {-1,-1}};
uint32_t l_30 = 0;
l_30 = (((!l_5) & bar()) != l_14[1][1]); /* miscompiled */
return l_30;
}
Description:
The value stored in l_30 should be 1. At -O0, the value is 0.
The buggy code is when the l_14[1][1] is being compared with value of
expression ((!l_5) & bar()).
Command line options:
pagariya at aleph:~/tmp$ clang -ccc-host-triple msp430-elf
-I/home/pagariya/res-pagariya/llvm-msp430/msp430/include -nostdinc -v -O0 -S
test.c
clang version 1.1 (trunk 170)
Target: msp430-elf-
Thread model: posix
"/uusoc/facility/res/embed/users/pagariya/llvm-msp430/bin/clang" -cc1 -triple
msp430-elf- -S -disable-free -main-file-name test.c -mrelocation-model static
-mdisable-fp-elim -v -nostdinc -resource-dir
/uusoc/facility/res/embed/users/pagariya/llvm-msp430/lib/clang/1.1
-I/home/pagariya/res-pagariya/llvm-msp430/msp430/include -O0 -fmessage-length
102 -fgnu-runtime -fdiagnostics-show-option -fcolor-diagnostics -o test.s -x c
test.c
clang -cc1 version 1.1 based upon llvm 2.7svn hosted on i386-pc-linux-gnu
#include "..." search starts here:
#include <...> search starts here:
/home/pagariya/res-pagariya/llvm-msp430/msp430/include
/uusoc/facility/res/embed/users/pagariya/llvm-msp430/lib/clang/1.1/include
pagariya at aleph:~/tmp$ clang -ccc-host-triple msp430-elf
-L/home/pagariya/res-pagariya/llvm-msp430/lib/msp430
-L/home/pagariya/res-pagariya/llvm-msp430/msp430/lib
-L/home/pagariya/res-pagariya/llvm-msp430/lib/gcc-lib/msp430/3.2.3
-Wl,-m,msp430x1611 -o test.elf
/home/pagariya/res-pagariya/llvm-msp430/msp430/lib/crt430x1611.o test.s -lgcc
-v
clang version 1.1 (trunk 170)
Target: msp430-elf-
Thread model: posix
"/uusoc/facility/res/embed/users/pagariya/llvm-msp430/bin/msp430-as" -o
/tmp/cc-dBq7CS.o test.s
"/uusoc/facility/res/embed/users/pagariya/llvm-msp430/bin/msp430-ld" -o
test.elf -L/home/pagariya/res-pagariya/llvm-msp430/lib/msp430
-L/home/pagariya/res-pagariya/llvm-msp430/msp430/lib
-L/home/pagariya/res-pagariya/llvm-msp430/lib/gcc-lib/msp430/3.2.3 -m
msp430x1611 /home/pagariya/res-pagariya/llvm-msp430/msp430/lib/crt430x1611.o
/tmp/cc-dBq7CS.o -lgcc -L../lib/ -lcompiler_rt.Generic -lc
--
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