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

           Summary: likely wrong code bug
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


[reg...@gamow ~]$ clang -O0 small.c -o small
[reg...@gamow ~]$ ./small 
p_6 = 1
[reg...@gamow ~]$ clang -O1 small.c -o small
[reg...@gamow ~]$ ./small 
p_6 = 0
[reg...@gamow ~]$ clang -v 
clang version 2.9 (trunk 122551)
Target: x86_64-unknown-linux-gnu
Thread model: posix
[reg...@gamow ~]$ cat small.c
int g_403 = 1;
int g_462 = 0;

int printf(const char *format, ...);

int func_18(int p_22)
{
    return g_403;
}

unsigned short foo(unsigned short u1, unsigned short u2)
{
    return u1 * u2;
}

int func_3(unsigned char p_6)
{
    int *l_708[2];
    int i;
    for (i = 0; i < 2; i++)
    {
        l_708[i] = &g_462;
    }

    for (i = 0; i < 1; i++)
    {
        if (func_18(p_6) >= foo(1, p_6))
        {
            printf("p_6 = %d\n", p_6);
            return p_6;
        }
        if (l_708[0] == &g_462)
        {
            return 99;
        }
    }
    return 99;
}

int main(int argc, char* argv[])
{
    func_3(1);
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to