public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/95248] New: GCC produces incorrect code with -O3 for loops
@ 2020-05-20 21:27 vsevolod.livinskij at frtk dot ru
2020-05-21 7:51 ` [Bug tree-optimization/95248] [11 Regression] GCC produces incorrect code with -O3 for loops since r11-272-gb6ff3ddecfa93d53 marxin at gcc dot gnu.org
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: vsevolod.livinskij at frtk dot ru @ 2020-05-20 21:27 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95248
Bug ID: 95248
Summary: GCC produces incorrect code with -O3 for loops
Product: gcc
Version: 10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: vsevolod.livinskij at frtk dot ru
Target Milestone: ---
GCC produces incorrect code with -O3 for loops
Error:
>$ gcc -O0 driver.cpp func.cpp && ./a.out
1
>$ gcc -O3 driver.cpp func.cpp && ./a.out
0
Reproducer:
>$ cat driver.cpp
#include <stdio.h>
int var_2 = -2013646301;
int var_3 = -1126567434;
unsigned int var_12 = 1;
unsigned int var_19;
unsigned int arr_25 [24] [21] [15] [17] [15] ;
void test();
int main() {
test();
printf("%u\n", var_19);
}
>$ cat func.cpp
extern int var_2;
extern int var_3;
extern unsigned int var_12;
extern unsigned int var_19;
extern unsigned int arr_25 [24] [21] [15] [17] [15] ;
void test() {
for (int a = 0; a < 3; a = 42)
for (int b = 0; b < 20; b++)
for (int c = 0; c < 4; c = 4)
for (int d = 0; d < 6; d += 4)
for (int e = 0; e < 4; e += 2) {
arr_25[a][b][c][d][e] = var_2 || var_3;
var_19 = var_12;
}
}
GCC version:
gcc version 11.0.0 (ed63c387aa0bc1846082524455a6ff1fcec40f9d)
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug tree-optimization/95248] [11 Regression] GCC produces incorrect code with -O3 for loops since r11-272-gb6ff3ddecfa93d53
2020-05-20 21:27 [Bug tree-optimization/95248] New: GCC produces incorrect code with -O3 for loops vsevolod.livinskij at frtk dot ru
@ 2020-05-21 7:51 ` marxin at gcc dot gnu.org
2020-05-22 6:11 ` rguenth at gcc dot gnu.org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-05-21 7:51 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95248
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |marxin at gcc dot gnu.org,
| |rguenth at gcc dot gnu.org
Known to fail| |11.0
Summary|GCC produces incorrect code |[11 Regression] GCC
|with -O3 for loops |produces incorrect code
| |with -O3 for loops since
| |r11-272-gb6ff3ddecfa93d53
Ever confirmed|0 |1
Known to work| |10.1.0
Last reconfirmed| |2020-05-21
Status|UNCONFIRMED |NEW
--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Confirmed, started with r11-272-gb6ff3ddecfa93d53.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug tree-optimization/95248] [11 Regression] GCC produces incorrect code with -O3 for loops since r11-272-gb6ff3ddecfa93d53
2020-05-20 21:27 [Bug tree-optimization/95248] New: GCC produces incorrect code with -O3 for loops vsevolod.livinskij at frtk dot ru
2020-05-21 7:51 ` [Bug tree-optimization/95248] [11 Regression] GCC produces incorrect code with -O3 for loops since r11-272-gb6ff3ddecfa93d53 marxin at gcc dot gnu.org
@ 2020-05-22 6:11 ` rguenth at gcc dot gnu.org
2020-05-22 9:46 ` cvs-commit at gcc dot gnu.org
2020-05-22 9:47 ` rguenth at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-05-22 6:11 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95248
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Target Milestone|--- |11.0
Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Mine.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug tree-optimization/95248] [11 Regression] GCC produces incorrect code with -O3 for loops since r11-272-gb6ff3ddecfa93d53
2020-05-20 21:27 [Bug tree-optimization/95248] New: GCC produces incorrect code with -O3 for loops vsevolod.livinskij at frtk dot ru
2020-05-21 7:51 ` [Bug tree-optimization/95248] [11 Regression] GCC produces incorrect code with -O3 for loops since r11-272-gb6ff3ddecfa93d53 marxin at gcc dot gnu.org
2020-05-22 6:11 ` rguenth at gcc dot gnu.org
@ 2020-05-22 9:46 ` cvs-commit at gcc dot gnu.org
2020-05-22 9:47 ` rguenth at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-05-22 9:46 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95248
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:
https://gcc.gnu.org/g:b6ed2e2bca54d1d290f553549d28b0c60a0f240f
commit r11-563-gb6ed2e2bca54d1d290f553549d28b0c60a0f240f
Author: Richard Biener <rguenther@suse.de>
Date: Fri May 22 08:48:04 2020 +0200
tree-optimization/95248 - fix oversight in SM rewrite
This fixes a leftover early out in determining the sequence of stores
to materialize.
2020-05-22 Richard Biener <rguenther@suse.de>
PR tree-optimization/95248
* tree-ssa-loop-im.c (sm_seq_valid_bb): Remove bogus early out.
* gcc.dg/torture/pr95248.c: New testcase.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug tree-optimization/95248] [11 Regression] GCC produces incorrect code with -O3 for loops since r11-272-gb6ff3ddecfa93d53
2020-05-20 21:27 [Bug tree-optimization/95248] New: GCC produces incorrect code with -O3 for loops vsevolod.livinskij at frtk dot ru
` (2 preceding siblings ...)
2020-05-22 9:46 ` cvs-commit at gcc dot gnu.org
@ 2020-05-22 9:47 ` rguenth at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-05-22 9:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95248
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-05-22 9:47 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-20 21:27 [Bug tree-optimization/95248] New: GCC produces incorrect code with -O3 for loops vsevolod.livinskij at frtk dot ru
2020-05-21 7:51 ` [Bug tree-optimization/95248] [11 Regression] GCC produces incorrect code with -O3 for loops since r11-272-gb6ff3ddecfa93d53 marxin at gcc dot gnu.org
2020-05-22 6:11 ` rguenth at gcc dot gnu.org
2020-05-22 9:46 ` cvs-commit at gcc dot gnu.org
2020-05-22 9:47 ` rguenth at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).