------- Comment #11 from rguenth at gcc dot gnu dot org 2009-09-06 12:38 ------- We again have ANTIC_IN/OUT oscillation
ANTIC_OUT[] := { x_2 (0001), y_3 (0002), {pointer_plus_expr,x_2,4} (0011) } ANTIC_IN[] := { x_2 (0001), y_3 (0002), {pointer_plus_expr,x_2,4} (0011) } ANTIC_OUT[] := { x_2 (0001), y_3 (0002), {pointer_plus_expr,y_3,4} (0025) } ANTIC_IN[] := { x_2 (0001), y_3 (0002), {pointer_plus_expr,y_3,4} (0025) } for blocks 3, 9 and 6 which form a conditionally infinite loop. <bb 2>: <bb 3>: # x_2 = PHI <x_4(D)(2), y_3(6)> # y_3 = PHI <y_5(D)(2), x_2(6)> if (N_7(D) != 0) goto <bb 8>; else goto <bb 9>; <bb 9>: goto <bb 6>; <bb 8>: <bb 4>: # i_10 = PHI <i_20(10), 1(8)> D.1986_8 = i_10 * 4; D.1987_9 = y_3 + D.1986_8; D.1988_11 = x_2 + D.1986_8; D.1989_12 = *D.1988_11; D.1990_13 = x_2 + 4; D.1991_14 = *D.1990_13; D.1992_15 = D.1989_12 - D.1991_14; D.1993_16 = func (D.1992_15); *D.1987_9 = D.1993_16; if (D.1993_16 != 0) goto <bb 7>; else goto <bb 5>; <bb 5>: i_20 = i_10 + 1; if (N_7(D) >= i_20) goto <bb 10>; else goto <bb 11>; <bb 10>: goto <bb 4>; <bb 11>: <bb 6>: goto <bb 3>; <bb 7>: return; The maximal set has only {pointer_plus_expr,x_2,4} (0011), {pointer_plus_expr,y_3,4} (0025) is the result of phi translating {pointer_plus_expr,y_3,D.1986_8} (0007). Injecting that pair into the cycle via BB3 -> BB8 yields to the oscillation as from BB9 we get oscillating 11 which will mask out the other. It seems to me that whenever we encounter such a cycle as 3 -> 9 -> 6 -> 3 we may not inject the maximal set there as it may not really be the maximal set (which we can't really enlarge during phi translation, can we? It does fix this case obviously though). -- rguenth at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dberlin at gcc dot gnu dot | |org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41101