http://llvm.org/bugs/show_bug.cgi?id=21725

            Bug ID: 21725
           Summary: wrong results with union and strict-aliasing
           Product: libraries
           Version: 3.4
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Global Analyses
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Created attachment 13420
  --> http://llvm.org/bugs/attachment.cgi?id=13420&action=edit
test.c

The following testcase produces wrong results with '-O1' and higher (tested
with llvm-3.4 and llvm-3.5).
Disabling 'strict-aliasing' makes the problem go away.
We do believe that the behavior should be the same with and without
strict-aliasing.

It seems that initially, the write to 'u.s' is moved out of the loop.
(more exactly, after the loop)
Later on the loop is removed, with only the write to 'up->i' remaining.
As the store to 'u.s' is still following, the end result is not what we expect
to see.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to