http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55999
Bug #: 55999 Summary: gcc 4.7.2 -O2 -floop-parallelize-all generates incorrect code Classification: Unclassified Product: gcc Version: 4.7.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassig...@gcc.gnu.org ReportedBy: nfx...@gmail.com struct s { int8_t num, c; int8_t xs[4], ys[4]; }; void stuff(struct s *desc) { int n; for (n = 0; n < desc->num; n++) { desc->xs[n] = (n == 1 || n == 2) ? desc->c : 0; desc->ys[n] = (n == 1 || n == 2) ? desc->c : 0; } } desc->xs[0] is not 0 after calling this function, although it should be. The attached log was generated with gcc -v -save-temps gcc_issue.c gcc_issue_main.c -Wall -Wextra -O2 -floop-parallelize-all > log.txt 2>&1 The assert in gcc_issue_main.c should not be triggered (and is not triggered when removing -O2 or -floop-parallelize-all).