[Bug tree-optimization/79622] New: [7 Regression] Wrong code w/ -O2 -floop-nest-optimize
asolokha at gmx dot com
gcc-bugzilla@gcc.gnu.org
Mon Feb 20 03:56:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79622
Bug ID: 79622
Summary: [7 Regression] Wrong code w/ -O2 -floop-nest-optimize
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: asolokha at gmx dot com
Target Milestone: ---
At least gcc-7.0.0-alpha20170212 and gcc-7.0.0-alpha20170219 snapshots produce
wrong code for the following snippet w/ -O2 -floop-nest-optimize:
int bf;
int
main (void)
{
int dc[5];
for (bf = 0; bf < 2; ++bf)
{
int l9, g5 = -1;
for (l9 = 0; l9 < 5; ++l9)
{
dc[l9] = g5;
g5 = (dc[l9] > 0);
}
}
if (dc[0] != -1)
__builtin_abort ();
return 0;
}
% gcc-7.0.0-alpha20170219 -O2 -o good dsmbs5u1.c
% ./good
% echo $?
0
% gcc-7.0.0-alpha20170219 -O2 -floop-nest-optimize -o bad dsmbs5u1.c
% ./bad
zsh: abort (core dumped) ./bad
More information about the Gcc-bugs
mailing list