2017-02-07 Jakub Jelinek <jakub@redhat.com>
+ PR rtl-optimization/79386
+ * cprop.c (bypass_conditional_jumps): Initialize
+ bypass_last_basic_block already before splitting bbs after
+ unconditional traps...
+ (bypass_conditional_jumps): ... rather than here.
+
PR target/79299
* config/i386/sse.md (xtg_mode, gatherq_mode): New mode attrs.
(*avx512f_gathersi<mode>, *avx512f_gathersi<mode>_2,
if (ENTRY_BLOCK_PTR_FOR_FN (cfun)->next_bb == EXIT_BLOCK_PTR_FOR_FN (cfun))
return 0;
- bypass_last_basic_block = last_basic_block_for_fn (cfun);
mark_dfs_back_edges ();
changed = 0;
}
}
+ /* Make sure bypass_conditional_jumps will ignore not just its new
+ basic blocks, but also the ones after unconditional traps (those are
+ unreachable and will be eventually removed as such). */
+ bypass_last_basic_block = last_basic_block_for_fn (cfun);
+
while (!uncond_traps.is_empty ())
{
rtx_insn *insn = uncond_traps.pop ();
+2017-02-07 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/79386
+ * gcc.c-torture/compile/pr79386.c: New test.
+
2017-02-07 Dominik Vogt <vogt@linux.vnet.ibm.com>
Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
--- /dev/null
+/* PR rtl-optimization/79386 */
+
+int a, b;
+
+int
+foo (int x)
+{
+ int c;
+ int *d, *e;
+
+ if (b == 0)
+ {
+ c = 0;
+ e = &b;
+ d = &b;
+ }
+ else
+ {
+ int f;
+
+ c = 1;
+ for (f = 0; f < 9; ++f)
+ c *= 3;
+ e = (int *) (__UINTPTR_TYPE__) c;
+ d = &x;
+ }
+ *e = c < 3;
+ if (*e != 0)
+ {
+ int g;
+
+ b += (a != 0) ? a : 1;
+ if (g != 0 || x != 0)
+ *d = 0;
+ if (b >= 0)
+ {
+ if (g != 0)
+ g = x;
+ if (*d / g != 0)
+ for (;;)
+ ;
+ }
+ }
+
+ return b * (a != 0 && *d != 0);
+}