+2018-02-08 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/84233
+ * tree-ssa-phiprop.c (propagate_with_phi): Use separate
+ changed flag instead of boguously re-using phi_inserted.
+
2018-02-08 Martin Jambor <mjambor@suse.cz>
* hsa-gen.c (get_symbol_for_decl): Set program allocation for
+2018-02-08 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/84233
+ * g++.dg/torture/pr84233.C: New testcase.
+
2018-02-08 Richard Biener <rguenther@suse.de>
PR tree-optimization/84278
--- /dev/null
+// { dg-do compile }
+// { dg-additional-options "-w" }
+
+void a(const char *, int, const char *, const char *);
+template <typename b> void c(b);
+struct d {
+ long e;
+ template <typename> union f;
+ template <typename h> union f<h *> {
+ f(h *i) : j(i) {}
+ h *j;
+ long bits;
+ };
+ static int k(volatile long &i) { return *(int *)f<volatile long *>(&i).bits; }
+ typedef long g;
+ operator g() volatile {
+ int l = k(e);
+ c(l);
+ }
+};
+struct : d {
+ } m, n;
+bool o;
+void p() { (o ? m : n) ? (void)0 : a("", 5, "", ""); }
+
use_operand_p arg_p, use;
ssa_op_iter i;
bool phi_inserted;
+ bool changed;
tree type = NULL_TREE;
if (!POINTER_TYPE_P (TREE_TYPE (ptr))
/* Replace the first dereference of *ptr if there is one and if we
can move the loads to the place of the ptr phi node. */
phi_inserted = false;
+ changed = false;
FOR_EACH_IMM_USE_STMT (use_stmt, ui, ptr)
{
gimple *def_stmt;
unlink_stmt_vdef (use_stmt);
gsi_remove (&gsi, true);
- phi_inserted = true;
+ changed = true;
}
/* Found a proper dereference. Insert a phi node if this
gsi_remove (&gsi, true);
phi_inserted = true;
+ changed = true;
}
else
{
load. */
gimple_assign_set_rhs1 (use_stmt, res);
update_stmt (use_stmt);
+ changed = true;
}
next:;
/* Continue searching for a proper dereference. */
}
- return phi_inserted;
+ return changed;
}
/* Main entry for phiprop pass. */