[LLVMbugs] [Bug 12899] New: wrong code bug

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun May 20 14:35:11 PDT 2012


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

             Bug #: 12899
           Summary: wrong code bug
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: regehr at cs.utah.edu
                CC: chenyang at cs.utah.edu, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


[regehr at dyson r56]$ clang -O0 small.c ; ./a.out 
0
[regehr at dyson r56]$ clang -O2 small.c ; ./a.out 
1
[regehr at dyson r56]$ clang -v
clang version 3.2 (trunk 157145)
Target: x86_64-unknown-linux-gnu
Thread model: posix
[regehr at dyson r56]$ cat small.c
int printf (const char *, ...);
struct
{
    volatile int f0;
    int f3;
    int f4;
} a, b =
{
    1
};
int c;
void
fn1 ()
{
    c = b.f0;
    b = a;
}
int
main ()
{
    b = a;
    fn1 ();
    printf ("%d\n", c);
    return 0;
}

-- 
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