[LLVMbugs] [Bug 7592] New: (a == 0 || a < 0 || a > 0)

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jul 8 03:25:17 PDT 2010


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

           Summary: (a == 0 || a < 0 || a > 0)
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: Edmund.Grimley-Evans at arm.com
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=5187)
 --> (http://llvm.org/bugs/attachment.cgi?id=5187)
test cases

Perhaps someone is interested in this. In the two functions defined below (the
code is also in the attachment) the call to unused() is unreachable. GCC 4.4.1
seems to get this right, but Clang/LLVM rev 107760 didn't when invoked like
this:

clang -cc1 -triple thumbv7-eabi -O3 -target-cpu cortex-a8 -S tri.c -o tri.s

int unused();

int f1(int a)
{
  return a == 0 ? 11 : a < 0 ? 22 : a > 0 ? 33 : unused();
}

int f2(int a)
{
  if (a == 0)
    return 11;
  if (a < 0)
    return 22;
  if (a > 0)
    return 33;
  return unused();
}

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