<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - immarg operand has non-immediate parameter error after r355981"
   href="https://bugs.llvm.org/show_bug.cgi?id=41079">41079</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>immarg operand has non-immediate parameter error after r355981
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>douglas_yung@playstation.sony.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>