This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/61171] vectorization fails for a reduction in presence of subtraction


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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
it's a matter of association being "unfortunate" or vector reduction detection
being too simplistic.

  # prephitmp_21 = PHI <pretmp_20(4), _9(7)>
...
  _2 = pretmp_18 + prephitmp_21;
  _9 = _2 - _6;

needs to be associated as

  _2 = pretmp_18 - _6;
  _9 = prephitmp_21 + _2;

usually reassoc is responsible for ensuring this but given its last iteration
is before LIM pulls out the global it has no chance to fix things up.

One fix would be to split out enough from reassoc into a worker that can
be called from vectorization or to run LIM before reassoc.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]