The previous "fix" for the PR just fixed the testcase by chance. The following (more dangerous at this point I thought) fix instead attacks the issue correctly, fixing the DF problem to be no longer unstable. Hopefully - the events are that while everything is sound value-wise (which is where we try to converge), how we handle value expressions in the intersection of ANTIC_INs can lead to oscillations in the value-sets via clean()ing of expressions that do not have their dependencies in the value-set (and thus removing values). So if the expression set oscillates between _9 and *ptr_1 (from a stmt _9 = *ptr_1) the value-sets can oscillate as well.
Fixed similarly to how we fixed a testcase in PHI translation - prefer a NAME (which is never going to be pruned). A very real fix would simply allow more than one expression for each value and defer which one to choose to clean(), but several helpers would not be very happy with that. Bootstrapped and tested on x86_64-unknown-linux-gnu, queued for stage1. Maybe I'm re-trying the "real" fix above anyway... (union the expression sets) Richard. 2016-04-15 Richard Biener <rguent...@suse.de> PR tree-optimization/70623 * tree-ssa-pre.c (bitmap_set_and): Like in PHI translation, keep a NAME if we have more than one expression for a value in the anded sets. Index: gcc/tree-ssa-pre.c =================================================================== *** gcc/tree-ssa-pre.c (revision 234970) --- gcc/tree-ssa-pre.c (working copy) *************** static void bitmap_value_insert_into_set *** 459,464 **** --- 455,462 ---- static void bitmap_value_replace_in_set (bitmap_set_t, pre_expr); static void bitmap_set_copy (bitmap_set_t, bitmap_set_t); static bool bitmap_set_contains_value (bitmap_set_t, unsigned int); + static void bitmap_set_replace_value (bitmap_set_t, unsigned int, + const pre_expr); static void bitmap_insert_into_set (bitmap_set_t, pre_expr); static void bitmap_insert_into_set_1 (bitmap_set_t, pre_expr, unsigned int, bool); *************** bitmap_set_and (bitmap_set_t dest, bitma *** 750,755 **** --- 748,766 ---- bitmap_clear_bit (&dest->expressions, i); } bitmap_clear (&temp); + /* The expression sets may contain different expressions for + the same value. Keep the "better" one - like when + phi-translating, prefer NAMEs. Other values may later + be pruned by pruning expressions with dependencies no + longer there during clean. */ + EXECUTE_IF_SET_IN_BITMAP (&orig->expressions, 0, i, bi) + { + pre_expr expr = expression_for_id (i); + if (expr->kind != NAME) + continue; + unsigned int value_id = get_expr_value_id (expr); + bitmap_set_replace_value (dest, value_id, expr); + } } }