http://llvm.org/bugs/show_bug.cgi?id=17073
Bill Wendling <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |INVALID --- Comment #1 from Bill Wendling <[email protected]> --- The SIGFPE is correct. See the comments: int a, b, d, e, *f = &b, g, i; char c; int main() { /* '&c == (void*)&a' is false */ bar (&c == (void *)&a); return 0; } void bar(int p) { /* 'p' is 0 */ lbl: if (*f) g = 0; int **l = &f; *l = 0; for (; i < 1; i++) { if (i) /* i == 1 */ goto lbl; /* 'd == 0' and 'p == 0' (see above) * Therefore, this call is 'foo(2, 0)' */ if (foo (2, d || p)) { int **m = &f; *m = &e; } /* i == 1 */ } } int foo(int p1, long long p2) { /* 'p1 == 2' and 'p2' == 0 * This implies 'p1 % p2' is UB. */ return p2 == 0 ? 0 : p1 % p2; } So, it looks like it's valid for it to have a SIGFPE. The other optimization levels don't convert to the same code (of course). It results in either the '%' never being called or possibly never emitted. -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ LLVMbugs mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs
