This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[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
- From: "segher at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 04 Jul 2017 17:59:55 +0000
- Subject: [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
- Auto-submitted: auto-generated
- References: <bug-81291-4@http.gcc.gnu.org/bugzilla/>
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.