[Bug target/81291] [5/6/7/8 Regression] wrong code with -O2 -fno-rerun-cse-after-loop -fno-tree-ter -fno-tree-vrp -funroll-loops due to improper carry

segher at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jul 4 18:00:00 GMT 2017


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

--- Comment #2 from Segher Boessenkool <segher at gcc dot gnu.org> ---
To answer your last question (from comment 1) first: at expand
time we have:

  d.3_10 = d;
  _11 = (long long unsigned int) d.3_10;
  c.4_12 = c;
  e.5_14 = e;
  _15 = (long long unsigned int) e.5_14;
  _20 = _11 + _15;
  _19 = c.4_12 + _20;
  return _19;

so it is adding a bunch of u64's.  We could add them as 32-bit
words (it cannot overflow) and only then convert to 64-bit, but
the gimple optimisers do not figure that out.  combine is left
to pick up the pieces, but it does something wrong it seems.


More information about the Gcc-bugs mailing list