https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62631

--- Comment #33 from amker at gcc dot gnu.org ---
(In reply to Eric Botcazou from comment #31)
> The test also fails on PowerPC, the 2 IVs are kept by ivopts.

On targets like ARM, the biv(i) is eliminated with biv(p).  PowerPC is
different, it only supports pre-increment addressing mode, so GIV(p-4) is
selected for the array reference.  GCC now is conservative in iv elimination by
only considering original BIV and nowrapping IVs.  Related code is in function
iv_elimination_compare_lt as below:

  /* We need to know that the candidate induction variable does not overflow.
     While more complex analysis may be used to prove this, for now just
     check that the variable appears in the original program and that it
     is computed in a type that guarantees no overflows.  */
  cand_type = TREE_TYPE (cand->iv->base);
  if (cand->pos != IP_ORIGINAL || !nowrap_type_p (cand_type))
    return false;

Another place we can improve.

Reply via email to