[LLVMbugs] [Bug 14551] New: clang hangs with -Os when block nested in for and if

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Dec 8 19:15:50 PST 2012


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

             Bug #: 14551
           Summary: clang hangs with -Os when block nested in for and if
           Product: clang
           Version: 3.1
          Platform: PC
        OS/Version: MacOS X
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: llvm at ext.emilb.us
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Perhaps I'm missing something, but the following code:

$ cat hang_clang.c 
void hang_clang() {
  void (^block)();
  __block int foo = 0;
  for (int i = 0; i < 10; i++) {
    if (foo) {
      block = ^{
      };
    }
  }
}

on the following platform:

$ clang -v
Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin11.4.2
Thread model: posix

appears to hang clang when complied under -Os:

$ clang -x objective-c -fobjc-arc -Os -c hang_clang.c 
^C

(variants using -O<n> do not hang).

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