https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66375
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |law at gcc dot gnu.org --- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> --- PRE doesn't seem to do sth wrong here. The testcase can be fixed by for example disabling VRP2. VRP2 needs either store-motion or complete unrolling to make it trigger the miscompile. Nicest IL before VRP2 is with -fno-ivopts -fno-tree-loop-im. The transform VRP2 does is Folding statement: if (a.4_17 <= 13) Simplified relational if (a.4_17 <= 13) into if (a.4_17 != 14) and Registering jump thread: (6, 7) incoming edge; (7, 8) normal; Threaded jump 6 --> 7 to 12 <bb 6>: # prephitmp_3 = PHI <prephitmp_22(5)> # prephitmp_39 = PHI <prephitmp_22(5)> <bb 7>: # prephitmp_26 = PHI <prephitmp_39(6), pretmp_23(3)> if (prephitmp_26 != 113) goto <bb 8>; else goto <bb 9>; <bb 8>: __builtin_abort (); so it looks jump-threading related to me. Somehow the equivalences I see being recorded miss the backedge for prephitmp_22 but only record zero.