* [Bug rtl-optimization/107248] Sparc V8 Invalid Stack Pointer Code
2022-10-13 13:21 [Bug rtl-optimization/107248] New: Sparc V8 Invalid Stack Pointer Code dennis.borde at ohb dot de
@ 2022-10-13 13:25 ` dennis.borde at ohb dot de
2022-10-13 20:28 ` [Bug target/107248] " pinskia at gcc dot gnu.org
` (11 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: dennis.borde at ohb dot de @ 2022-10-13 13:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107248
--- Comment #1 from Dennis Borde <dennis.borde at ohb dot de> ---
Created attachment 53701
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53701&action=edit
gcc -v output
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/107248] Sparc V8 Invalid Stack Pointer Code
2022-10-13 13:21 [Bug rtl-optimization/107248] New: Sparc V8 Invalid Stack Pointer Code dennis.borde at ohb dot de
2022-10-13 13:25 ` [Bug rtl-optimization/107248] " dennis.borde at ohb dot de
@ 2022-10-13 20:28 ` pinskia at gcc dot gnu.org
2022-10-13 22:09 ` [Bug target/107248] wrong scheduling of stack adjustment in leaf function at -O2 ebotcazou at gcc dot gnu.org
` (10 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-10-13 20:28 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107248
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2022-10-13
Keywords| |ABI, wrong-code
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Looks like for sparc_leaf_function_p, there is a missing a emit_insn
(gen_frame_blockage ()) .
Which was added in the non leaf case with r0-114040-ge98b1defdd2c6b .
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/107248] wrong scheduling of stack adjustment in leaf function at -O2
2022-10-13 13:21 [Bug rtl-optimization/107248] New: Sparc V8 Invalid Stack Pointer Code dennis.borde at ohb dot de
2022-10-13 13:25 ` [Bug rtl-optimization/107248] " dennis.borde at ohb dot de
2022-10-13 20:28 ` [Bug target/107248] " pinskia at gcc dot gnu.org
@ 2022-10-13 22:09 ` ebotcazou at gcc dot gnu.org
2022-10-13 22:10 ` ebotcazou at gcc dot gnu.org
` (9 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2022-10-13 22:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107248
Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ebotcazou at gcc dot gnu.org
Summary|Sparc V8 Invalid Stack |wrong scheduling of stack
|Pointer Code |adjustment in leaf function
| |at -O2
Keywords|ABI |
Target|sparc-rtems |sparc-*-*
--- Comment #3 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Yes, it's the same bug as on ARM and MIPS, but one decade later...
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/107248] wrong scheduling of stack adjustment in leaf function at -O2
2022-10-13 13:21 [Bug rtl-optimization/107248] New: Sparc V8 Invalid Stack Pointer Code dennis.borde at ohb dot de
` (2 preceding siblings ...)
2022-10-13 22:09 ` [Bug target/107248] wrong scheduling of stack adjustment in leaf function at -O2 ebotcazou at gcc dot gnu.org
@ 2022-10-13 22:10 ` ebotcazou at gcc dot gnu.org
2022-10-14 9:56 ` cvs-commit at gcc dot gnu.org
` (8 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2022-10-13 22:10 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107248
Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |ebotcazou at gcc dot gnu.org
--- Comment #4 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Fixing.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/107248] wrong scheduling of stack adjustment in leaf function at -O2
2022-10-13 13:21 [Bug rtl-optimization/107248] New: Sparc V8 Invalid Stack Pointer Code dennis.borde at ohb dot de
` (3 preceding siblings ...)
2022-10-13 22:10 ` ebotcazou at gcc dot gnu.org
@ 2022-10-14 9:56 ` cvs-commit at gcc dot gnu.org
2022-10-14 9:57 ` cvs-commit at gcc dot gnu.org
` (7 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-10-14 9:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107248
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Eric Botcazou <ebotcazou@gcc.gnu.org>:
https://gcc.gnu.org/g:e39b170695a161feba7401b7d21d824db9ee1f8f
commit r13-3296-ge39b170695a161feba7401b7d21d824db9ee1f8f
Author: Eric Botcazou <ebotcazou@adacore.com>
Date: Fri Oct 14 11:52:04 2022 +0200
Fix PR target/107248
This is the infamous PR rtl-optimization/38644 rearing its ugly head for
leaf functions on SPARC more than a decade later... Richard E.'s generic
solution has never been implemented so let's do as other RISC back-ends
did.
gcc/
PR target/107248
* config/sparc/sparc.cc (sparc_expand_prologue): Emit a frame
blockage for leaf functions.
(sparc_flat_expand_prologue): Emit frame instead of full blockage.
(sparc_expand_epilogue): Emit a frame blockage for leaf functions.
(sparc_flat_expand_epilogue): Emit frame instead of full blockage.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/107248] wrong scheduling of stack adjustment in leaf function at -O2
2022-10-13 13:21 [Bug rtl-optimization/107248] New: Sparc V8 Invalid Stack Pointer Code dennis.borde at ohb dot de
` (4 preceding siblings ...)
2022-10-14 9:56 ` cvs-commit at gcc dot gnu.org
@ 2022-10-14 9:57 ` cvs-commit at gcc dot gnu.org
2022-10-14 9:58 ` cvs-commit at gcc dot gnu.org
` (6 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-10-14 9:57 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107248
--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Eric Botcazou
<ebotcazou@gcc.gnu.org>:
https://gcc.gnu.org/g:a5a6598d5b1d29741993371310c0bb8ca57e190c
commit r12-8831-ga5a6598d5b1d29741993371310c0bb8ca57e190c
Author: Eric Botcazou <ebotcazou@adacore.com>
Date: Fri Oct 14 11:52:04 2022 +0200
Fix PR target/107248
This is the infamous PR rtl-optimization/38644 rearing its ugly head for
leaf functions on SPARC more than a decade later... Richard E.'s generic
solution has never been implemented so let's do as other RISC back-ends
did.
gcc/
PR target/107248
* config/sparc/sparc.cc (sparc_expand_prologue): Emit a frame
blockage for leaf functions.
(sparc_flat_expand_prologue): Emit frame instead of full blockage.
(sparc_expand_epilogue): Emit a frame blockage for leaf functions.
(sparc_flat_expand_epilogue): Emit frame instead of full blockage.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/107248] wrong scheduling of stack adjustment in leaf function at -O2
2022-10-13 13:21 [Bug rtl-optimization/107248] New: Sparc V8 Invalid Stack Pointer Code dennis.borde at ohb dot de
` (5 preceding siblings ...)
2022-10-14 9:57 ` cvs-commit at gcc dot gnu.org
@ 2022-10-14 9:58 ` cvs-commit at gcc dot gnu.org
2022-10-14 10:00 ` cvs-commit at gcc dot gnu.org
` (5 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-10-14 9:58 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107248
--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Eric Botcazou
<ebotcazou@gcc.gnu.org>:
https://gcc.gnu.org/g:3f4b65df625edae3e8829718af721ad2330b3f22
commit r11-10311-g3f4b65df625edae3e8829718af721ad2330b3f22
Author: Eric Botcazou <ebotcazou@adacore.com>
Date: Fri Oct 14 11:52:04 2022 +0200
Fix PR target/107248
This is the infamous PR rtl-optimization/38644 rearing its ugly head for
leaf functions on SPARC more than a decade later... Richard E.'s generic
solution has never been implemented so let's do as other RISC back-ends
did.
gcc/
PR target/107248
* config/sparc/sparc.c (sparc_expand_prologue): Emit a frame
blockage for leaf functions.
(sparc_flat_expand_prologue): Emit frame instead of full blockage.
(sparc_expand_epilogue): Emit a frame blockage for leaf functions.
(sparc_flat_expand_epilogue): Emit frame instead of full blockage.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/107248] wrong scheduling of stack adjustment in leaf function at -O2
2022-10-13 13:21 [Bug rtl-optimization/107248] New: Sparc V8 Invalid Stack Pointer Code dennis.borde at ohb dot de
` (6 preceding siblings ...)
2022-10-14 9:58 ` cvs-commit at gcc dot gnu.org
@ 2022-10-14 10:00 ` cvs-commit at gcc dot gnu.org
2022-10-14 10:03 ` ebotcazou at gcc dot gnu.org
` (4 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-10-14 10:00 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107248
--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Eric Botcazou
<ebotcazou@gcc.gnu.org>:
https://gcc.gnu.org/g:d0ef37c35b7ff7324b4567652380f32079d46088
commit r10-11034-gd0ef37c35b7ff7324b4567652380f32079d46088
Author: Eric Botcazou <ebotcazou@adacore.com>
Date: Fri Oct 14 11:52:04 2022 +0200
Fix PR target/107248
This is the infamous PR rtl-optimization/38644 rearing its ugly head for
leaf functions on SPARC more than a decade later... Richard E.'s generic
solution has never been implemented so let's do as other RISC back-ends
did.
gcc/
PR target/107248
* config/sparc/sparc.c (sparc_expand_prologue): Emit a frame
blockage for leaf functions.
(sparc_flat_expand_prologue): Emit frame instead of full blockage.
(sparc_expand_epilogue): Emit a frame blockage for leaf functions.
(sparc_flat_expand_epilogue): Emit frame instead of full blockage.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/107248] wrong scheduling of stack adjustment in leaf function at -O2
2022-10-13 13:21 [Bug rtl-optimization/107248] New: Sparc V8 Invalid Stack Pointer Code dennis.borde at ohb dot de
` (7 preceding siblings ...)
2022-10-14 10:00 ` cvs-commit at gcc dot gnu.org
@ 2022-10-14 10:03 ` ebotcazou at gcc dot gnu.org
2022-10-17 11:05 ` dennis.borde at ohb dot de
` (3 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2022-10-14 10:03 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107248
Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Target Milestone|--- |10.5
Resolution|--- |FIXED
--- Comment #9 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Fixed on all active branches, but the fix should be backportable onto older
release branches without any change. Thanks for reporting the problem.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/107248] wrong scheduling of stack adjustment in leaf function at -O2
2022-10-13 13:21 [Bug rtl-optimization/107248] New: Sparc V8 Invalid Stack Pointer Code dennis.borde at ohb dot de
` (8 preceding siblings ...)
2022-10-14 10:03 ` ebotcazou at gcc dot gnu.org
@ 2022-10-17 11:05 ` dennis.borde at ohb dot de
2022-10-25 8:00 ` ebotcazou at gcc dot gnu.org
` (2 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: dennis.borde at ohb dot de @ 2022-10-17 11:05 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107248
--- Comment #10 from Dennis Borde <dennis.borde at ohb dot de> ---
Much more important: Thanks for fixing it :-)
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/107248] wrong scheduling of stack adjustment in leaf function at -O2
2022-10-13 13:21 [Bug rtl-optimization/107248] New: Sparc V8 Invalid Stack Pointer Code dennis.borde at ohb dot de
` (9 preceding siblings ...)
2022-10-17 11:05 ` dennis.borde at ohb dot de
@ 2022-10-25 8:00 ` ebotcazou at gcc dot gnu.org
2023-01-03 8:30 ` cederman at gaisler dot com
2023-01-03 8:58 ` ebotcazou at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2022-10-25 8:00 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107248
--- Comment #11 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> Much more important: Thanks for fixing it :-)
You're welcome. It looks like -mtune=leon or -mtune-leon3 can mitigate it.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/107248] wrong scheduling of stack adjustment in leaf function at -O2
2022-10-13 13:21 [Bug rtl-optimization/107248] New: Sparc V8 Invalid Stack Pointer Code dennis.borde at ohb dot de
` (10 preceding siblings ...)
2022-10-25 8:00 ` ebotcazou at gcc dot gnu.org
@ 2023-01-03 8:30 ` cederman at gaisler dot com
2023-01-03 8:58 ` ebotcazou at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: cederman at gaisler dot com @ 2023-01-03 8:30 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107248
Daniel Cederman <cederman at gaisler dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |cederman at gaisler dot com
--- Comment #12 from Daniel Cederman <cederman at gaisler dot com> ---
Just to make it clear, since we have had customers asking about it, it is still
possible to trigger this issue with -mtune=leon or -mtune-leon3, though it
might make it less likely to happen.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/107248] wrong scheduling of stack adjustment in leaf function at -O2
2022-10-13 13:21 [Bug rtl-optimization/107248] New: Sparc V8 Invalid Stack Pointer Code dennis.borde at ohb dot de
` (11 preceding siblings ...)
2023-01-03 8:30 ` cederman at gaisler dot com
@ 2023-01-03 8:58 ` ebotcazou at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2023-01-03 8:58 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107248
--- Comment #13 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> Just to make it clear, since we have had customers asking about it, it is
> still possible to trigger this issue with -mtune=leon or -mtune-leon3,
> though it might make it less likely to happen.
Very likely not, but proving it would be quite hard.
^ permalink raw reply [flat|nested] 14+ messages in thread