<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 - clang crashes with "-mllvm -enable-newgvn": error in backend: Found 2 in/out CFI information errors."
   href="https://bugs.llvm.org/show_bug.cgi?id=35253">35253</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang crashes with "-mllvm -enable-newgvn": error in backend: Found 2 in/out CFI information errors.
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </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>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>LLVM Codegen
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>helloqirun@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>It happens with newgvn enabled. Clang trunk works fine.


$ clang-trunk -v
clang version 6.0.0 (trunk 317674)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin



$ clang-trunk -mllvm -enable-newgvn -O2 abc.c
abc.c:7:13: warning: | has lower precedence than ==; == will be evaluated first
[-Wparentheses]
    b &= p1 | c == p1;
            ^~~~~~~~~
abc.c:7:13: note: place parentheses around the '==' expression to silence this
warning
    b &= p1 | c == p1;
            ^
              (      )
abc.c:7:13: note: place parentheses around the | expression to evaluate it
first
    b &= p1 | c == p1;
            ^
         (     )
abc.c:27:10: warning: expression result unused [-Wunused-value]
      *h || 0;
      ~~ ^  ~

*** The incoming offset of a successor is inconsistent. ***
- function:    fn2
- basic block: BB#5 for.body9.split (0x8d28088)
Successor BB#6 has incoming offset (8), while BB#5 has outgoing offset (16).

*** The outgoing offset of a predecessor is inconsistent. ***
- function:    fn2
- basic block: BB#6 for.end13 (0x8d28148)
Predecessor BB#5 has outgoing offset (16), while BB#6 has incoming offset (8).
fatal error: error in backend: Found 2 in/out CFI information errors.
clang-6.0: error: clang frontend command failed with exit code 70 (use -v to
see invocation)
clang version 6.0.0 (trunk 317674)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
clang-6.0: note: diagnostic msg: PLEASE submit a bug report to
<a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a> and include the crash backtrace, preprocessed source, and
associated run script.
clang-6.0: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-6.0: note: diagnostic msg: /tmp/abc-c70957.c
clang-6.0: note: diagnostic msg: /tmp/abc-c70957.sh
clang-6.0: note: diagnostic msg: 

********************


$ cat abc.c
long a;
short b;
int d;
void fn1(char p1) {
  int c = a = 1;
  for (; a <= 77; a++) {
    b &= p1 | c == p1;
    if (b)
      p1 | (c = 0) ? a = 5335016568 : 0;
  }
}
void fn2() {
  char e;
  for (; d;) {
    long f;
    fn1(a <= 0);
    for (; a <= 9;)
      if (0) {
        int *g;
      l1:
        *g = 2;
      }
    for (; f <= 8;) {
      char *h = &e;
      goto l1;
    l2:
      *h || 0;
    }
  }
  goto l2;
}</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>