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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
On ppc64le I see

  offset.3_15 = ~stride.2_11;
  _45 = (unsigned long) stride.2_11;
  _49 = (unsigned long) offset.3_15;
  _14 = _45 + 1;
  _51 = _14 + _49;

which is supposed to be optimized via

  /* ~A + A -> -1 */
  (simplify
   (plus:c (bit_not @0) @0)
   (if (!TYPE_OVERFLOW_TRAPS (type))
    { build_all_ones_cst (type); }))

but on x86_64 is optimized by VRP2 it seems.  Note that on x86_64 we have
a simpler

  offset.3_15 = ~stride.2_11;
  _34 = (unsigned long) stride.2_11;
  _38 = (unsigned long) offset.3_15;
  _39 = _34 + _38;

and not face the +1 which confuses things on ppc64le here.

It is IVOPTs generating the above two variants and reassoc not "fixing"
the association.  Which also hints at that this is reassocs job to catch.

This is what I'm going to try now.  And it has that code already, just
it is confused by the casts.  Fixing that.

Reply via email to