+2017-09-29 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ PR tree-optimization/82337
+ * gimple-ssa-strength-reduction.c (find_phi_def): Don't record a
+ phi definition if the PHI result appears in an abnormal PHI.
+ (find_basis_for_base_expr): Don't record a basis if the LHS of the
+ basis appears in an abnormal PHI.
+
2017-09-29 Richard Biener <rguenther@suse.de>
* graphite-isl-ast-to-gimple.c
c = base_cand_from_table (base);
- if (!c || c->kind != CAND_PHI)
+ if (!c || c->kind != CAND_PHI
+ || SSA_NAME_OCCURS_IN_ABNORMAL_PHI (gimple_phi_result (c->cand_stmt)))
return 0;
return c->cand_num;
gimple_bb (one_basis->cand_stmt)))
continue;
+ tree lhs = gimple_assign_lhs (one_basis->cand_stmt);
+ if (lhs && TREE_CODE (lhs) == SSA_NAME
+ && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (lhs))
+ continue;
+
if (!basis || basis->cand_num < one_basis->cand_num)
basis = one_basis;
}
+2017-09-29 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ PR tree-optimization/82337
+ * gcc.c-torture/compile/pr82337.c: New file.
+
2017-09-29 Javier Miranda <miranda@adacore.com>
* gnat.dg/unchecked_union3.adb: New testcase.
--- /dev/null
+/* PR82337: SLSR needs to prevent abnormal SSA names from
+ serving as a basis. */
+char *a, *b, *c;
+
+struct d {
+ short e;
+ char f[];
+};
+
+extern void j (void);
+
+void
+g() {
+ struct d *h;
+ char *i;
+ int d;
+ do {
+ i = h->f + d;
+ 20 ? j() : 0;
+ i = c;
+ if (__builtin_setjmp (h))
+ b = h->f + d;
+ d = (int)(*i);
+ } while (a);
+}