[LLVMbugs] [Bug 16108] New: Wrong constant folding
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Wed May 22 05:41:48 PDT 2013
http://llvm.org/bugs/show_bug.cgi?id=16108
Bug ID: 16108
Summary: Wrong constant folding
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: Backend: X86
Assignee: unassignedbugs at nondot.org
Reporter: ishiura-compiler at ml.kwansei.ac.jp
CC: llvmbugs at cs.uiuc.edu
Classification: Unclassified
LLVM (git) + clang (3.4) for i386 miscompiles the following code
where LLONG_MAX == 9223372036854775807.
$ cat error.c
int main (void)
{
int x = 1;
long long t = 1LL;
t = 1LL << (( x << 8 ) + ( -224 ));
if ( t != 4294967296LL ){ __builtin_abort(); }
return 0;
}
$ clang error.c
$ ./a.out
Aborted (core dumped)
There was no problem with an x86_64 target.
$ clang -v
clang version 3.4 (http://llvm.org/git/clang.git
800ff45b49e306a5706f249d3289281dc224dcb3)
(http://llvm.org/git/llvm.git
f8cd1ee516c845285fd6a7ee27abb5339c5f3fba)
Target: i386-pc-linux-gnu
Thread model: posix
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130522/fc095e97/attachment.html>
More information about the llvm-bugs
mailing list