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 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


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.

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