[LLVMbugs] [Bug 15738] New: loop and casting causes clang to hang at -O2

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Apr 12 23:35:26 PDT 2013


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

            Bug ID: 15738
           Summary: loop and casting causes clang to hang at -O2
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: dhazeghi at yahoo.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The following testcase causes current clang trunk to go into and infinite loop
(hang) when compiled at -O2 and above.

$ clang -v
clang version 3.3 (trunk 179371)
Target: x86_64-pc-linux-gnu
Thread model: posix
$ clang -O1 -c small.c
$ clang -O2 -c small.c
^C
$ cat small.c
struct
{
    int f0;
}
a;
int b, c, d, e;
void fn1 ();
void fn2 ()
{
    fn1 ();
}

void
fn1 ()
{
    int *f = &c, *g = &a.f0;
    *g = (int)f;
    b = 0;
    for (; b != 60; ++b)
    {
        e = (*g > (d = 0)) % 5;
        *g = 0 == e - *g * 80;
    }
}

-- 
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/20130413/bb4d4957/attachment.html>


More information about the llvm-bugs mailing list