https://bugs.llvm.org/show_bug.cgi?id=47416

            Bug ID: 47416
           Summary: [x86] Failure to remove all statements in function
                    that doesn't return anything but should
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: unassignedb...@nondot.org
          Reporter: gabrav...@gmail.com
                CC: craig.top...@gmail.com, llvm-bugs@lists.llvm.org,
                    llvm-...@redking.me.uk, spatel+l...@rotateright.com

int f(int a, int b)
{
    if ((a < 4 && b == 'r') || (a == 1 && (b == 'h' || b == 'i')) || (a == 2))
        a = b;
}

Compiling this results in this assembly output:

f(int, int):
  cmp edi, 1

It should be possible to remove the `cmp edi, 1` as far as I know. I guess this
isn't really by itself considering the behaviour is undefined anyway but this
behaviour itself seems rather weird.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to