* tree-ssa-forwprop.c (ssa_forward_propagate_and_combine): Remove
prev and prev_initialized vars, gimple_set_plf (stmt, GF_PLF_1, false)
before processing it and gimple_set_plf (stmt, GF_PLF_1, true) if it
doesn't need to be revisited, look for earliest stmt with
!gimple_plf (stmt, GF_PLF_1) if something changed.
* gcc.c-torture/compile/pr53226.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187328
138bc75d-0d04-0410-961f-
82ee72b054a4
+2012-05-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/53226
+ * tree-ssa-forwprop.c (ssa_forward_propagate_and_combine): Remove
+ prev and prev_initialized vars, gimple_set_plf (stmt, GF_PLF_1, false)
+ before processing it and gimple_set_plf (stmt, GF_PLF_1, true) if it
+ doesn't need to be revisited, look for earliest stmt with
+ !gimple_plf (stmt, GF_PLF_1) if something changed.
+
2012-05-09 Terry Guo <terry.guo@arm.com>
* genmultilib: Update copyright dates.
+2012-05-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/53226
+ * gcc.c-torture/compile/pr53226.c: New test.
+
2012-05-09 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* gcc.target/i386/hle-add-acq-1.c: Allow for ; after lock.
--- /dev/null
+/* PR tree-optimization/53226 */
+
+void
+foo (unsigned long *x, char y, char z)
+{
+ int i;
+ for (i = y; i < z; ++i)
+ {
+ unsigned long a = ((unsigned char) i) & 63UL;
+ unsigned long b = 1ULL << a;
+ *x |= b;
+ }
+}
FOR_EACH_BB (bb)
{
- gimple_stmt_iterator gsi, prev;
- bool prev_initialized;
+ gimple_stmt_iterator gsi;
/* Apply forward propagation to all stmts in the basic-block.
Note we update GSI within the loop as necessary. */
/* Combine stmts with the stmts defining their operands.
Note we update GSI within the loop as necessary. */
- prev_initialized = false;
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi);)
{
gimple stmt = gsi_stmt (gsi);
bool changed = false;
+ /* Mark stmt as potentially needing revisiting. */
+ gimple_set_plf (stmt, GF_PLF_1, false);
+
switch (gimple_code (stmt))
{
case GIMPLE_ASSIGN:
{
/* If the stmt changed then re-visit it and the statements
inserted before it. */
- if (!prev_initialized)
+ for (; !gsi_end_p (gsi); gsi_prev (&gsi))
+ if (gimple_plf (gsi_stmt (gsi), GF_PLF_1))
+ break;
+ if (gsi_end_p (gsi))
gsi = gsi_start_bb (bb);
else
- {
- gsi = prev;
- gsi_next (&gsi);
- }
+ gsi_next (&gsi);
}
else
{
- prev = gsi;
- prev_initialized = true;
+ /* Stmt no longer needs to be revisited. */
+ gimple_set_plf (stmt, GF_PLF_1, true);
gsi_next (&gsi);
}
}