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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
The issue is

t.f:7:0: note: Analyze phi: prephitmp_32 = PHI <pretmp_31(4), _18(7)>

t.f:7:0: note: swapping oprnds: _18 = _13 + _16;

t.f:7:0: note: reduction: detected reduction chain: _18 = _16 + _13;

t.f:7:0: note: Detected reduction.

in the non-working vs.

t.f:7:0: note: Analyze phi: prephitmp_32 = PHI <pretmp_31(4), _18(7)>

t.f:7:0: note: detected reduction: _18 = _17 + prephitmp_32;

t.f:7:0: note: Detected reduction.

in the working case (thus in the non-working case we detect a SLP reduction
which this really isn't - which means we fail to detect it as regular
reduction, I think because of association issues).  Working:

  <bb 5>:
  # i_1 = PHI <1(4), i_20(7)>
  # prephitmp_32 = PHI <pretmp_31(4), _18(7)>
...
  _18 = _17 + prephitmp_32;

non-working:

  # prephitmp_32 = PHI <pretmp_31(4), _18(7)>
...
  _13 = _12 + prephitmp_32;
  _18 = _13 + _16;

there is tree reassoc code to make sure the reduction is properly associated
but it doesn't seem to trigger here?  See swap_ops_for_binary_stmt and the
comment before it.

Reply via email to