public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/115697] New: Miscompilation with -fgraphite-identity at -O2
@ 2024-06-28 10:14 michael at orlitzky dot com
2024-06-28 11:47 ` [Bug tree-optimization/115697] [11/12/13/14/15 Regression] " xry111 at gcc dot gnu.org
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: michael at orlitzky dot com @ 2024-06-28 10:14 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115697
Bug ID: 115697
Summary: Miscompilation with -fgraphite-identity at -O2
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: michael at orlitzky dot com
Target Milestone: ---
While debugging a test failure in the flint library
(https://github.com/flintlib/flint/issues/2029), we seem to have discovered a
miscompilation. Fredrik Johansson was able to come up with a minimal
reproducer. This may be a duplicate of bug 47048, but having more reproducible
test cases never hurts.
$ gcc-15 -O2 -Wall -Wextra main.c
$ ./a.out
6 4 1
$ gcc-15 -O2 -fgraphite-identity -Wall -Wextra main.c
$ ./a.out
3 2 1
$ cat main.c
#include <stdio.h>
void
shift(long * c, long n)
{
long i, j;
if (n <= 62)
{
for (i = n - 2; i >= 0; i--)
for (j = i; j < n - 1; j++)
c[j] += c[j + 1];
}
}
int main(void)
{
long c[3];
volatile long n = 3;
c[0] = 3;
c[1] = 2;
c[2] = 1;
shift(c, n);
printf("%ld %ld %ld\n", c[0], c[1], c[2]);
}
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug tree-optimization/115697] [11/12/13/14/15 Regression] Miscompilation with -fgraphite-identity at -O2
2024-06-28 10:14 [Bug tree-optimization/115697] New: Miscompilation with -fgraphite-identity at -O2 michael at orlitzky dot com
@ 2024-06-28 11:47 ` xry111 at gcc dot gnu.org
2024-06-28 21:01 ` pinskia at gcc dot gnu.org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: xry111 at gcc dot gnu.org @ 2024-06-28 11:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115697
Xi Ruoyao <xry111 at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |xry111 at gcc dot gnu.org
Known to fail| |11.1.0
Summary|Miscompilation with |[11/12/13/14/15 Regression]
|-fgraphite-identity at -O2 |Miscompilation with
| |-fgraphite-identity at -O2
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
Last reconfirmed| |2024-06-28
Keywords| |needs-bisection
Known to work| |10.5.0
--- Comment #1 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
Confirmed.
- Code from GCC 6 - 10 outputs "6 4 1" correctly.
- Code from GCC 11 - 14 outputs "3 2 1".
- Code from GCC 5 crashes with SIGFPE.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug tree-optimization/115697] [11/12/13/14/15 Regression] Miscompilation with -fgraphite-identity at -O2
2024-06-28 10:14 [Bug tree-optimization/115697] New: Miscompilation with -fgraphite-identity at -O2 michael at orlitzky dot com
2024-06-28 11:47 ` [Bug tree-optimization/115697] [11/12/13/14/15 Regression] " xry111 at gcc dot gnu.org
@ 2024-06-28 21:01 ` pinskia at gcc dot gnu.org
2024-07-19 13:25 ` [Bug tree-optimization/115697] [12/13/14/15 " rguenth at gcc dot gnu.org
2024-07-31 2:18 ` [Bug tree-optimization/115697] [12/13/14/15 Regression] Miscompilation with -fgraphite-identity at -O2 since r11-3917-g28290cb50c7dbf sjames at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-06-28 21:01 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115697
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |11.5
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug tree-optimization/115697] [12/13/14/15 Regression] Miscompilation with -fgraphite-identity at -O2
2024-06-28 10:14 [Bug tree-optimization/115697] New: Miscompilation with -fgraphite-identity at -O2 michael at orlitzky dot com
2024-06-28 11:47 ` [Bug tree-optimization/115697] [11/12/13/14/15 Regression] " xry111 at gcc dot gnu.org
2024-06-28 21:01 ` pinskia at gcc dot gnu.org
@ 2024-07-19 13:25 ` rguenth at gcc dot gnu.org
2024-07-31 2:18 ` [Bug tree-optimization/115697] [12/13/14/15 Regression] Miscompilation with -fgraphite-identity at -O2 since r11-3917-g28290cb50c7dbf sjames at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-07-19 13:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115697
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|11.5 |12.5
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 11 branch is being closed.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug tree-optimization/115697] [12/13/14/15 Regression] Miscompilation with -fgraphite-identity at -O2 since r11-3917-g28290cb50c7dbf
2024-06-28 10:14 [Bug tree-optimization/115697] New: Miscompilation with -fgraphite-identity at -O2 michael at orlitzky dot com
` (2 preceding siblings ...)
2024-07-19 13:25 ` [Bug tree-optimization/115697] [12/13/14/15 " rguenth at gcc dot gnu.org
@ 2024-07-31 2:18 ` sjames at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-07-31 2:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115697
Sam James <sjames at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[12/13/14/15 Regression] |[12/13/14/15 Regression]
|Miscompilation with |Miscompilation with
|-fgraphite-identity at -O2 |-fgraphite-identity at -O2
| |since
| |r11-3917-g28290cb50c7dbf
CC| |rguenth at gcc dot gnu.org
Keywords|needs-bisection |
--- Comment #3 from Sam James <sjames at gcc dot gnu.org> ---
r11-3917-g28290cb50c7dbf
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-07-31 2:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-28 10:14 [Bug tree-optimization/115697] New: Miscompilation with -fgraphite-identity at -O2 michael at orlitzky dot com
2024-06-28 11:47 ` [Bug tree-optimization/115697] [11/12/13/14/15 Regression] " xry111 at gcc dot gnu.org
2024-06-28 21:01 ` pinskia at gcc dot gnu.org
2024-07-19 13:25 ` [Bug tree-optimization/115697] [12/13/14/15 " rguenth at gcc dot gnu.org
2024-07-31 2:18 ` [Bug tree-optimization/115697] [12/13/14/15 Regression] Miscompilation with -fgraphite-identity at -O2 since r11-3917-g28290cb50c7dbf sjames 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).