This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/77436] Incorrect constant result for summing loop inserted
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 31 Aug 2016 21:30:10 +0000
- Subject: [Bug c/77436] Incorrect constant result for summing loop inserted
- Auto-submitted: auto-generated
- References: <bug-77436-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77436
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |NEW
Last reconfirmed| |2016-08-31
Resolution|INVALID |---
Ever confirmed|0 |1
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Now the following program does not have any overflow in it (only wrapping) and
still causes wrong code:
int main(int argc, char *argv[]) {
unsigned sum = 0;
for (int x = -(0x7fffffff -1); x <= (0x7fffffff -1); x++)
sum += x;
printf("%08x\n", sum);
return 0;
}