[LLVMbugs] [Bug 9322] New: clang doesn't DCE dead switch cases (breaks Linux kernel at -O0)

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Feb 24 18:23:33 PST 2011


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

           Summary: clang doesn't DCE dead switch cases (breaks Linux
                    kernel at -O0)
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: sharparrow1 at yahoo.com
                CC: llvmbugs at cs.uiuc.edu


Testcase (reduced from the raw_smp_processor_id macro in the kernel):
void a() {
  switch (4) {
    case 1:
      asm("movb $0, %%eax" : : );
      break;
    case 4:
      asm("movl $0, %%eax" : : );
      break;
  } 
}

gcc compiles this just fine at all optimization levels; clang complains because
the movb isn't valid.  Arguably, this code is abusive, but it doesn't seem very
hard to support.

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