[LLVMbugs] [Bug 10709] New: Miscompilation of checksumming code
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Fri Aug 19 20:04:56 PDT 2011
http://llvm.org/bugs/show_bug.cgi?id=10709
Summary: Miscompilation of checksumming code
Product: libraries
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: Loop Optimizer
AssignedTo: unassignedbugs at nondot.org
ReportedBy: bhelf at flitterfly.whirpon.com
CC: llvmbugs at cs.uiuc.edu
Created an attachment (id=7105)
--> (http://llvm.org/bugs/attachment.cgi?id=7105)
Test case that shows bug
I've got some code that does a (weak) checksum calculation of a data file,
which appears to be miscompiled by clang/llvm at -O3. When it's compiled at
-O0 the result matches the output of gcc/msvc/suncc/mipspro, and when it's -O3,
it's coming up with a different result.
I've got a simplified test case that demonstrates this, attached below.
The line marked with // $$$ crazy loop is important. If you take out that for
statement (even though it's just a 1 iteration loop) the problem goes away. I
have no idea what that implies, to be honest.
Everything is using unsigned math, so I believe that it's not a problem with
undefined signed math behavior. I believe that the hash_string code is working
correctly, since the "namesum" value it outputs is consistent between the -O3
and -O0 runs. Using a simplified calculation for that string hash makes the
problem go away as well, it appears, so it's still there.
This is on linux x86-64, with the current clang and llvm svn trunk checkouts as
of 19 Aug 2011.
--
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