<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 - Broken module with setjmp + emscripten-sjlj"
   href="https://bugs.llvm.org/show_bug.cgi?id=43097">43097</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Broken module with setjmp + emscripten-sjlj
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </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>Backend: WebAssembly
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>dschuff@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The following code:

typedef __PTRDIFF_TYPE__ b;
#define c(d, h, f, g) (d, f)
#define k(d, h, f, g, i, j, n, l, m, q, o, p) (d h)
extern "C" int setjmp(int);
typedef struct {
  int ab;
} r;
#define s(t)                                                                  
\
  r t;                                                                        
\
  if (setjmp(t.ab)) {
struct af ag c(af *, , b, );
struct u {
  u *a;
} * an;
#define ai(aj) aj->a
struct af {
  u *a;
} al;
#define ak(e) (e->a)
int am;
void ao k(af *, ap, , , , , , , , , , ) {
  ag(&al, am);
  s(b) u *aj;
  u *aq ak(ap);
  for (;; an = aj, aj = ai(aq))
    if (an) {
      s(ar)
    }
}
}
}

compiled with:
bin/clang++ -target wasm32-emscripten ~/s/reducebug/test.cpp -Os -c -mllvm
-enable-emscripten-sjlj

Causes the following output:
Instruction does not dominate all uses!
  %aj.0 = phi %struct.u* [ %5, %for.inc ], [ undef, %if.then ]
  %4 = phi %struct.u* [ %aj.0, %for.inc ], [ %.pr, %if.then ]
in function _Z2aoP2af
fatal error: error in backend: Broken function found, compilation aborted!


If you disable emscripten-sjlj it doesn't fail, so it seems likely that the
error is in the backend pass for that, rather than the frontend.</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>