[LLVMbugs] [Bug 15479] New: non-terminating loop at -Os causes clang to hang

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Mar 8 13:08:24 PST 2013


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

            Bug ID: 15479
           Summary: non-terminating loop at -Os causes clang to hang
           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 code (derived from a test generated by csmith) causes
top-of-trunk clang to get stuck in an infinite loop when compiled at -Os or
higher.  At -O1 or below, the compilation succeeds.  This may be related for
15386 but that bug only triggers at -O2 or higher.

$ clang-trunk -v
clang version 3.3 (trunk 176687)
Target: x86_64-pc-linux-gnu
Thread model: posix
$ clang-trunk -O1 -c crash8.c
$ clang-trunk -Os -c crash8.c
<hangs>
$ cat crash8.c

int a, b;
int fn1 (int p1, unsigned char p2)
{
    return p1 * p2;
}

int fn3();

void fn2 ()
{
    int c;
    for (;;)
    {
        c ^= a &= 1;
        if (fn3 ())
            c = 0;
        else
            b = b;
        c = fn1 (b > 0, c);
    }
}

-- 
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/20130308/5cf4019a/attachment.html>


More information about the llvm-bugs mailing list