------- Comment #5 from amonakov at gcc dot gnu dot org  2010-01-25 17:06 
-------
We fail to find number of iterations after rewriting reductions out of SSA. 
Before graphite pass, IR looks like (for the previous testcase, "pr42771.c"):

<bb 9>:
  # j_26 = PHI <j_20(10)>

<bb 10>:
  # j_33 = PHI <j_26(9), 1(16)>
  D.2747_16 = B[j_33][0];
  D.2748_17 = j_33 + -1;
  D.2749_18 = B[D.2748_17][0];
  D.2750_19 = D.2749_18 ^ D.2747_16;
  B[j_33][0] = D.2750_19;
  j_20 = j_33 + 1;
  if (jm_14(D) > j_20)
    goto <bb 9>;
  else
    goto <bb 11>;

At the time of the ICE, IR is transformed to
(gdb) call debug_loop(use_loop, 3)
loop_3 (header = 10, latch = 9, niter = (unsigned int) jm_14(D) + 4294967294,
upper_bound = 2147483646)
{
  bb_9 (preds = {bb_10 }, succs = {bb_10 })
  {
  <bb 9>:
    # .MEM_24 = PHI <.MEM_78(10)>
    # VUSE <.MEM_24>
    j_26 = Close_Phi.13[0];
    # .MEM_79 = VDEF <.MEM_24>
    General_Reduction.14[0] = j_26;

  }
  bb_10 (preds = {bb_9 bb_16 }, succs = {bb_9 bb_11 })
  {
  <bb 10>:
    # .MEM_15 = PHI <.MEM_79(9), .MEM_77(16)>
    # VUSE <.MEM_15>
    D.2766_76 = General_Reduction.14[0];
    j_33 = D.2766_76;
    # VUSE <.MEM_15>
    D.2747_16 = B[j_33][0];
    D.2748_17 = j_33 + -1;
    # VUSE <.MEM_15>
    D.2749_18 = B[D.2748_17][0];
    D.2750_19 = D.2749_18 ^ D.2747_16;
    # .MEM_30 = VDEF <.MEM_15>
    B[j_33][0] = D.2750_19;
    j_20 = j_33 + 1;
    # .MEM_78 = VDEF <.MEM_30>
    Close_Phi.13[0] = j_20;
    if (jm_14(D) > j_20)
      goto <bb 9>;
    else
      goto <bb 11>;
  }
}

We would fail to discover scalar evolution of j_33.


-- 

amonakov at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amonakov at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42771

Reply via email to