[llvm-bugs] [Bug 43097] New: Broken module with setjmp + emscripten-sjlj

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Aug 22 17:02:07 PDT 2019


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

            Bug ID: 43097
           Summary: Broken module with setjmp + emscripten-sjlj
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: WebAssembly
          Assignee: unassignedbugs at nondot.org
          Reporter: dschuff at google.com
                CC: llvm-bugs at lists.llvm.org

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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190823/4c4cf4e4/attachment-0001.html>


More information about the llvm-bugs mailing list