https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86865
Bug ID: 86865 Summary: [9 Regression] Wrong code w/ -O2 -floop-parallelize-all -fstack-reuse=none -fwrapv -fno-tree-ch -fno-tree-dce -fno-tree-dominator-opts -fno-tree-loop-ivcanon Product: gcc Version: 9.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: --- gcc-9.0.0-alpha20180729 snapshot (r263055) generates wrong code when compiling the following snippet w/ -O2 -floop-parallelize-all -fstack-reuse=none -fwrapv -fno-tree-ch -fno-tree-dce -fno-tree-dominator-opts -fno-tree-loop-ivcanon: int xy, tb; void bt (void) { for (xy = 0; xy >= 0; --xy) { int yt[8] = { 0 }; int pz[2] = { 0 }; int sa[32] = { 0 }; int us; for (us = 0; us < 8; ++us) yt[us] = 0; (void) yt; (void) pz; (void) sa; } tb = 1; } int main (void) { bt (); if (xy != -1) __builtin_abort (); return 0; } % gcc-9.0.0-alpha20180729 -O2 jdoeqjdo.c -o good && ./good % echo $? 0 % gcc-9.0.0-alpha20180729 -O2 -floop-parallelize-all -fstack-reuse=none -fwrapv -fno-tree-ch -fno-tree-dce -fno-tree-dominator-opts -fno-tree-loop-ivcanon jdoeqjdo.c -o bad && ./bad zsh: abort (core dumped) ./bad