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

            Bug ID: 41079
           Summary: immarg operand has non-immediate parameter error after
                    r355981
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedb...@nondot.org
          Reporter: douglas_y...@playstation.sony.com
                CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org

After upstream commit r355981, one of our internal tests started hitting an
error during compilation with optimizations enabled:

/* 1.cpp */
int test(int stuff)
{
    int res = 0;

    switch(__builtin_expect(stuff, stuff)) {
    case 0:
        res = 1;
        break;
    default:
        break;
    }
    return res;
}

$ clang -c -O2 1.cpp
immarg operand has non-immediate parameter
  %conv1 = sext i32 %2 to i64
  %expval = call i64 @llvm.expect.i64(i64 %conv, i64 %conv1)
in function _Z4testi
fatal error: error in backend: Broken function found, compilation aborted!
clang-9: error: clang frontend command failed with exit code 70 (use -v to see
invocation)
clang version 9.0.0 (trunk 355981)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/dyung/src/upstream/355981-linux/bin

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