https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67442
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Version|unknown |5.2.0
Keywords| |wrong-code
Last reconfirmed| |2015-09-03
Component|target |middle-end
Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot
gnu.org
Ever confirmed|0 |1
Summary|GCC 5.2.0 on x86_64 creates |[5/6 Regression] GCC 5.2.0
|invalid address on specific |on x86_64 creates invalid
|array index calculation |address on specific array
|through pointer |index calculation through
| |pointer
Target Milestone|--- |5.3
Known to fail| |5.2.0, 6.0
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed on x86_64 and the 5 branch with -O1 even:
main:
.LFB0:
.cfi_startproc
movabsq $foo+4294967408, %rax
movswl (%rax), %eax
ret
.original has:
short int value = *(bar + (sizetype) (((long unsigned int) i * (long unsigned
int) j) * 4294967292 + 16));
works correctly with -fstrict-overflow (or -O2). Some bug in folding
somewhere.
4.8 and 4.9 have
short int value = *(bar + (sizetype) (((long unsigned int) i * (long unsigned
int) j) * 18446744073709551612 + 16));