* [Bug target/114846] powerpc: epilogue in _Unwind_RaiseException corrupts return value due to __builtin_eh_return
2024-04-25 7:34 [Bug target/114846] New: powerpc: epilogue in _Unwind_RaiseException corrupts return value due to __builtin_eh_return pinskia at gcc dot gnu.org
@ 2024-04-25 9:23 ` linkw at gcc dot gnu.org
2024-04-25 9:25 ` linkw at gcc dot gnu.org
` (16 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: linkw at gcc dot gnu.org @ 2024-04-25 9:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114846
Kewen Lin <linkw at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Last reconfirmed| |2024-04-25
Status|UNCONFIRMED |NEW
CC| |bergner at gcc dot gnu.org,
| |linkw at gcc dot gnu.org,
| |segher at gcc dot gnu.org
Target|powerpc64-linux-gnu |powerpc64*-linux-gnu
|powerpc-linux-gnu |powerpc-linux-gnu
--- Comment #1 from Kewen Lin <linkw at gcc dot gnu.org> ---
Thanks for reporting, confirmed, it also fails on LE (ppc64le-linux).
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug target/114846] powerpc: epilogue in _Unwind_RaiseException corrupts return value due to __builtin_eh_return
2024-04-25 7:34 [Bug target/114846] New: powerpc: epilogue in _Unwind_RaiseException corrupts return value due to __builtin_eh_return pinskia at gcc dot gnu.org
2024-04-25 9:23 ` [Bug target/114846] " linkw at gcc dot gnu.org
@ 2024-04-25 9:25 ` linkw at gcc dot gnu.org
2024-04-25 21:37 ` pinskia at gcc dot gnu.org
` (15 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: linkw at gcc dot gnu.org @ 2024-04-25 9:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114846
--- Comment #2 from Kewen Lin <linkw at gcc dot gnu.org> ---
As https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114843#c8, we may need some
similar handling like r14-6440-g4b421728289e6f.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug target/114846] powerpc: epilogue in _Unwind_RaiseException corrupts return value due to __builtin_eh_return
2024-04-25 7:34 [Bug target/114846] New: powerpc: epilogue in _Unwind_RaiseException corrupts return value due to __builtin_eh_return pinskia at gcc dot gnu.org
2024-04-25 9:23 ` [Bug target/114846] " linkw at gcc dot gnu.org
2024-04-25 9:25 ` linkw at gcc dot gnu.org
@ 2024-04-25 21:37 ` pinskia at gcc dot gnu.org
2024-04-29 5:20 ` linkw at gcc dot gnu.org
` (14 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-04-25 21:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114846
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Kewen Lin from comment #2)
> As https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114843#c8, we may need some
> similar handling like r14-6440-g4b421728289e6f.
Note rs6000_emit_epilogue mostly handles eh_returns so it might not be as hard
as other targets.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug target/114846] powerpc: epilogue in _Unwind_RaiseException corrupts return value due to __builtin_eh_return
2024-04-25 7:34 [Bug target/114846] New: powerpc: epilogue in _Unwind_RaiseException corrupts return value due to __builtin_eh_return pinskia at gcc dot gnu.org
` (2 preceding siblings ...)
2024-04-25 21:37 ` pinskia at gcc dot gnu.org
@ 2024-04-29 5:20 ` linkw at gcc dot gnu.org
2024-04-29 9:04 ` linkw at gcc dot gnu.org
` (13 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: linkw at gcc dot gnu.org @ 2024-04-29 5:20 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114846
Kewen Lin <linkw at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |linkw at gcc dot gnu.org
Status|NEW |ASSIGNED
--- Comment #4 from Kewen Lin <linkw at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #3)
> (In reply to Kewen Lin from comment #2)
> > As https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114843#c8, we may need some
> > similar handling like r14-6440-g4b421728289e6f.
>
> Note rs6000_emit_epilogue mostly handles eh_returns so it might not be as
> hard as other targets.
Yes, making a patch.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug target/114846] powerpc: epilogue in _Unwind_RaiseException corrupts return value due to __builtin_eh_return
2024-04-25 7:34 [Bug target/114846] New: powerpc: epilogue in _Unwind_RaiseException corrupts return value due to __builtin_eh_return pinskia at gcc dot gnu.org
` (3 preceding siblings ...)
2024-04-29 5:20 ` linkw at gcc dot gnu.org
@ 2024-04-29 9:04 ` linkw at gcc dot gnu.org
2024-05-14 8:49 ` linkw at gcc dot gnu.org
` (12 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: linkw at gcc dot gnu.org @ 2024-04-29 9:04 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114846
--- Comment #5 from Kewen Lin <linkw at gcc dot gnu.org> ---
Created attachment 58067
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58067&action=edit
untested patch
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug target/114846] powerpc: epilogue in _Unwind_RaiseException corrupts return value due to __builtin_eh_return
2024-04-25 7:34 [Bug target/114846] New: powerpc: epilogue in _Unwind_RaiseException corrupts return value due to __builtin_eh_return pinskia at gcc dot gnu.org
` (4 preceding siblings ...)
2024-04-29 9:04 ` linkw at gcc dot gnu.org
@ 2024-05-14 8:49 ` linkw at gcc dot gnu.org
2024-05-29 2:15 ` cvs-commit at gcc dot gnu.org
` (11 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: linkw at gcc dot gnu.org @ 2024-05-14 8:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114846
Kewen Lin <linkw at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #58067|0 |1
is obsolete| |
--- Comment #6 from Kewen Lin <linkw at gcc dot gnu.org> ---
Created attachment 58201
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58201&action=edit
tested patch
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug target/114846] powerpc: epilogue in _Unwind_RaiseException corrupts return value due to __builtin_eh_return
2024-04-25 7:34 [Bug target/114846] New: powerpc: epilogue in _Unwind_RaiseException corrupts return value due to __builtin_eh_return pinskia at gcc dot gnu.org
` (5 preceding siblings ...)
2024-05-14 8:49 ` linkw at gcc dot gnu.org
@ 2024-05-29 2:15 ` cvs-commit at gcc dot gnu.org
2024-05-29 2:33 ` linkw at gcc dot gnu.org
` (10 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-05-29 2:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114846
--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Kewen Lin <linkw@gcc.gnu.org>:
https://gcc.gnu.org/g:e5fc5d42d25c86ae48178db04ce64d340a834614
commit r15-884-ge5fc5d42d25c86ae48178db04ce64d340a834614
Author: Kewen Lin <linkw@linux.ibm.com>
Date: Tue May 28 21:13:40 2024 -0500
rs6000: Don't clobber return value when eh_return called [PR114846]
As the associated test case in PR114846 shows, currently
with eh_return involved some register restoring for EH
RETURN DATA in epilogue can clobber the one which holding
the return value. Referring to the existing handlings in
some other targets, this patch makes eh_return expander
call one new define_insn_and_split eh_return_internal which
directly calls rs6000_emit_epilogue with epilogue_type
EPILOGUE_TYPE_EH_RETURN instead of the previous treating
normal return with crtl->calls_eh_return specially.
PR target/114846
gcc/ChangeLog:
* config/rs6000/rs6000-logue.cc (rs6000_emit_epilogue): As
EPILOGUE_TYPE_EH_RETURN would be passed as epilogue_type directly
now, adjust the relevant handlings on it.
* config/rs6000/rs6000.md (eh_return expander): Append by calling
gen_eh_return_internal and emit_barrier.
(eh_return_internal): New define_insn_and_split, call function
rs6000_emit_epilogue with epilogue type EPILOGUE_TYPE_EH_RETURN.
gcc/testsuite/ChangeLog:
* gcc.target/powerpc/pr114846.c: New test.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug target/114846] powerpc: epilogue in _Unwind_RaiseException corrupts return value due to __builtin_eh_return
2024-04-25 7:34 [Bug target/114846] New: powerpc: epilogue in _Unwind_RaiseException corrupts return value due to __builtin_eh_return pinskia at gcc dot gnu.org
` (6 preceding siblings ...)
2024-05-29 2:15 ` cvs-commit at gcc dot gnu.org
@ 2024-05-29 2:33 ` linkw at gcc dot gnu.org
2024-05-29 12:30 ` bergner at gcc dot gnu.org
` (9 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: linkw at gcc dot gnu.org @ 2024-05-29 2:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114846
--- Comment #8 from Kewen Lin <linkw at gcc dot gnu.org> ---
Should be fixed on trunk, it's not a regression, but we probably want
backporting this?
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug target/114846] powerpc: epilogue in _Unwind_RaiseException corrupts return value due to __builtin_eh_return
2024-04-25 7:34 [Bug target/114846] New: powerpc: epilogue in _Unwind_RaiseException corrupts return value due to __builtin_eh_return pinskia at gcc dot gnu.org
` (7 preceding siblings ...)
2024-05-29 2:33 ` linkw at gcc dot gnu.org
@ 2024-05-29 12:30 ` bergner at gcc dot gnu.org
2024-05-29 12:50 ` linkw at gcc dot gnu.org
` (8 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: bergner at gcc dot gnu.org @ 2024-05-29 12:30 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114846
--- Comment #9 from Peter Bergner <bergner at gcc dot gnu.org> ---
(In reply to Kewen Lin from comment #8)
> Should be fixed on trunk, it's not a regression, but we probably want
> backporting this?
For code correctness bugs, yes, we want them backported.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug target/114846] powerpc: epilogue in _Unwind_RaiseException corrupts return value due to __builtin_eh_return
2024-04-25 7:34 [Bug target/114846] New: powerpc: epilogue in _Unwind_RaiseException corrupts return value due to __builtin_eh_return pinskia at gcc dot gnu.org
` (8 preceding siblings ...)
2024-05-29 12:30 ` bergner at gcc dot gnu.org
@ 2024-05-29 12:50 ` linkw at gcc dot gnu.org
2024-06-21 19:53 ` bergner at gcc dot gnu.org
` (7 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: linkw at gcc dot gnu.org @ 2024-05-29 12:50 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114846
--- Comment #10 from Kewen Lin <linkw at gcc dot gnu.org> ---
(In reply to Peter Bergner from comment #9)
> (In reply to Kewen Lin from comment #8)
> > Should be fixed on trunk, it's not a regression, but we probably want
> > backporting this?
>
> For code correctness bugs, yes, we want them backported.
Thanks for confirming! Will do backporting after burn-in time.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug target/114846] powerpc: epilogue in _Unwind_RaiseException corrupts return value due to __builtin_eh_return
2024-04-25 7:34 [Bug target/114846] New: powerpc: epilogue in _Unwind_RaiseException corrupts return value due to __builtin_eh_return pinskia at gcc dot gnu.org
` (9 preceding siblings ...)
2024-05-29 12:50 ` linkw at gcc dot gnu.org
@ 2024-06-21 19:53 ` bergner at gcc dot gnu.org
2024-06-23 19:42 ` segher at gcc dot gnu.org
` (6 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: bergner at gcc dot gnu.org @ 2024-06-21 19:53 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114846
--- Comment #11 from Peter Bergner <bergner at gcc dot gnu.org> ---
(In reply to Kewen Lin from comment #10)
> (In reply to Peter Bergner from comment #9)
> > (In reply to Kewen Lin from comment #8)
> > > Should be fixed on trunk, it's not a regression, but we probably want
> > > backporting this?
> >
> > For code correctness bugs, yes, we want them backported.
>
> Thanks for confirming! Will do backporting after burn-in time.
Have we done the backports so we can just mark this bug a FIXED? ...or do we
still need to push the backports?
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug target/114846] powerpc: epilogue in _Unwind_RaiseException corrupts return value due to __builtin_eh_return
2024-04-25 7:34 [Bug target/114846] New: powerpc: epilogue in _Unwind_RaiseException corrupts return value due to __builtin_eh_return pinskia at gcc dot gnu.org
` (10 preceding siblings ...)
2024-06-21 19:53 ` bergner at gcc dot gnu.org
@ 2024-06-23 19:42 ` segher at gcc dot gnu.org
2024-06-24 1:43 ` cvs-commit at gcc dot gnu.org
` (5 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: segher at gcc dot gnu.org @ 2024-06-23 19:42 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114846
--- Comment #12 from Segher Boessenkool <segher at gcc dot gnu.org> ---
The backports have not been done yet.
It would be good if the blockage / barrier would get some comment btw, saying
what exactly it is intended to do! It is very much cargo-cult the way it is.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug target/114846] powerpc: epilogue in _Unwind_RaiseException corrupts return value due to __builtin_eh_return
2024-04-25 7:34 [Bug target/114846] New: powerpc: epilogue in _Unwind_RaiseException corrupts return value due to __builtin_eh_return pinskia at gcc dot gnu.org
` (11 preceding siblings ...)
2024-06-23 19:42 ` segher at gcc dot gnu.org
@ 2024-06-24 1:43 ` cvs-commit at gcc dot gnu.org
2024-06-24 1:45 ` cvs-commit at gcc dot gnu.org
` (4 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-06-24 1:43 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114846
--- Comment #13 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-14 branch has been updated by Kewen Lin <linkw@gcc.gnu.org>:
https://gcc.gnu.org/g:2b5e8f918ef0027d2af8e53c4e114e1d133fc609
commit r14-10342-g2b5e8f918ef0027d2af8e53c4e114e1d133fc609
Author: Kewen Lin <linkw@linux.ibm.com>
Date: Tue May 28 21:13:40 2024 -0500
rs6000: Don't clobber return value when eh_return called [PR114846]
As the associated test case in PR114846 shows, currently
with eh_return involved some register restoring for EH
RETURN DATA in epilogue can clobber the one which holding
the return value. Referring to the existing handlings in
some other targets, this patch makes eh_return expander
call one new define_insn_and_split eh_return_internal which
directly calls rs6000_emit_epilogue with epilogue_type
EPILOGUE_TYPE_EH_RETURN instead of the previous treating
normal return with crtl->calls_eh_return specially.
PR target/114846
gcc/ChangeLog:
* config/rs6000/rs6000-logue.cc (rs6000_emit_epilogue): As
EPILOGUE_TYPE_EH_RETURN would be passed as epilogue_type directly
now, adjust the relevant handlings on it.
* config/rs6000/rs6000.md (eh_return expander): Append by calling
gen_eh_return_internal and emit_barrier.
(eh_return_internal): New define_insn_and_split, call function
rs6000_emit_epilogue with epilogue type EPILOGUE_TYPE_EH_RETURN.
gcc/testsuite/ChangeLog:
* gcc.target/powerpc/pr114846.c: New test.
(cherry picked from commit e5fc5d42d25c86ae48178db04ce64d340a834614)
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug target/114846] powerpc: epilogue in _Unwind_RaiseException corrupts return value due to __builtin_eh_return
2024-04-25 7:34 [Bug target/114846] New: powerpc: epilogue in _Unwind_RaiseException corrupts return value due to __builtin_eh_return pinskia at gcc dot gnu.org
` (12 preceding siblings ...)
2024-06-24 1:43 ` cvs-commit at gcc dot gnu.org
@ 2024-06-24 1:45 ` cvs-commit at gcc dot gnu.org
2024-06-24 1:46 ` cvs-commit at gcc dot gnu.org
` (3 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-06-24 1:45 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114846
--- Comment #14 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Kewen Lin <linkw@gcc.gnu.org>:
https://gcc.gnu.org/g:dd54ed4ae417935300a3c4bb356d37c2ae7f731e
commit r13-8866-gdd54ed4ae417935300a3c4bb356d37c2ae7f731e
Author: Kewen Lin <linkw@linux.ibm.com>
Date: Tue May 28 21:13:40 2024 -0500
rs6000: Don't clobber return value when eh_return called [PR114846]
As the associated test case in PR114846 shows, currently
with eh_return involved some register restoring for EH
RETURN DATA in epilogue can clobber the one which holding
the return value. Referring to the existing handlings in
some other targets, this patch makes eh_return expander
call one new define_insn_and_split eh_return_internal which
directly calls rs6000_emit_epilogue with epilogue_type
EPILOGUE_TYPE_EH_RETURN instead of the previous treating
normal return with crtl->calls_eh_return specially.
PR target/114846
gcc/ChangeLog:
* config/rs6000/rs6000-logue.cc (rs6000_emit_epilogue): As
EPILOGUE_TYPE_EH_RETURN would be passed as epilogue_type directly
now, adjust the relevant handlings on it.
* config/rs6000/rs6000.md (eh_return expander): Append by calling
gen_eh_return_internal and emit_barrier.
(eh_return_internal): New define_insn_and_split, call function
rs6000_emit_epilogue with epilogue type EPILOGUE_TYPE_EH_RETURN.
gcc/testsuite/ChangeLog:
* gcc.target/powerpc/pr114846.c: New test.
(cherry picked from commit e5fc5d42d25c86ae48178db04ce64d340a834614)
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug target/114846] powerpc: epilogue in _Unwind_RaiseException corrupts return value due to __builtin_eh_return
2024-04-25 7:34 [Bug target/114846] New: powerpc: epilogue in _Unwind_RaiseException corrupts return value due to __builtin_eh_return pinskia at gcc dot gnu.org
` (13 preceding siblings ...)
2024-06-24 1:45 ` cvs-commit at gcc dot gnu.org
@ 2024-06-24 1:46 ` cvs-commit at gcc dot gnu.org
2024-06-24 1:49 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-06-24 1:46 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114846
--- Comment #15 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Kewen Lin <linkw@gcc.gnu.org>:
https://gcc.gnu.org/g:0fd6ae9b20913ab84d596448e14411eedbd324f9
commit r12-10579-g0fd6ae9b20913ab84d596448e14411eedbd324f9
Author: Kewen Lin <linkw@linux.ibm.com>
Date: Tue May 28 21:13:40 2024 -0500
rs6000: Don't clobber return value when eh_return called [PR114846]
As the associated test case in PR114846 shows, currently
with eh_return involved some register restoring for EH
RETURN DATA in epilogue can clobber the one which holding
the return value. Referring to the existing handlings in
some other targets, this patch makes eh_return expander
call one new define_insn_and_split eh_return_internal which
directly calls rs6000_emit_epilogue with epilogue_type
EPILOGUE_TYPE_EH_RETURN instead of the previous treating
normal return with crtl->calls_eh_return specially.
PR target/114846
gcc/ChangeLog:
* config/rs6000/rs6000-logue.cc (rs6000_emit_epilogue): As
EPILOGUE_TYPE_EH_RETURN would be passed as epilogue_type directly
now, adjust the relevant handlings on it.
* config/rs6000/rs6000.md (eh_return expander): Append by calling
gen_eh_return_internal and emit_barrier.
(eh_return_internal): New define_insn_and_split, call function
rs6000_emit_epilogue with epilogue type EPILOGUE_TYPE_EH_RETURN.
gcc/testsuite/ChangeLog:
* gcc.target/powerpc/pr114846.c: New test.
(cherry picked from commit e5fc5d42d25c86ae48178db04ce64d340a834614)
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug target/114846] powerpc: epilogue in _Unwind_RaiseException corrupts return value due to __builtin_eh_return
2024-04-25 7:34 [Bug target/114846] New: powerpc: epilogue in _Unwind_RaiseException corrupts return value due to __builtin_eh_return pinskia at gcc dot gnu.org
` (14 preceding siblings ...)
2024-06-24 1:46 ` cvs-commit at gcc dot gnu.org
@ 2024-06-24 1:49 ` cvs-commit at gcc dot gnu.org
2024-06-24 3:46 ` linkw at gcc dot gnu.org
2024-06-24 3:50 ` linkw at gcc dot gnu.org
17 siblings, 0 replies; 19+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-06-24 1:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114846
--- Comment #16 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Kewen Lin <linkw@gcc.gnu.org>:
https://gcc.gnu.org/g:549701628b64a7c4ac9bb5f9623e83a8dc1d828c
commit r11-11535-g549701628b64a7c4ac9bb5f9623e83a8dc1d828c
Author: Kewen Lin <linkw@linux.ibm.com>
Date: Tue May 28 21:13:40 2024 -0500
rs6000: Don't clobber return value when eh_return called [PR114846]
As the associated test case in PR114846 shows, currently
with eh_return involved some register restoring for EH
RETURN DATA in epilogue can clobber the one which holding
the return value. Referring to the existing handlings in
some other targets, this patch makes eh_return expander
call one new define_insn_and_split eh_return_internal which
directly calls rs6000_emit_epilogue with epilogue_type
EPILOGUE_TYPE_EH_RETURN instead of the previous treating
normal return with crtl->calls_eh_return specially.
PR target/114846
gcc/ChangeLog:
* config/rs6000/rs6000-logue.c (rs6000_emit_epilogue): As
EPILOGUE_TYPE_EH_RETURN would be passed as epilogue_type directly
now, adjust the relevant handlings on it.
* config/rs6000/rs6000.md (eh_return expander): Append by calling
gen_eh_return_internal and emit_barrier.
(eh_return_internal): New define_insn_and_split, call function
rs6000_emit_epilogue with epilogue type EPILOGUE_TYPE_EH_RETURN.
gcc/testsuite/ChangeLog:
* gcc.target/powerpc/pr114846.c: New test.
(cherry picked from commit e5fc5d42d25c86ae48178db04ce64d340a834614)
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug target/114846] powerpc: epilogue in _Unwind_RaiseException corrupts return value due to __builtin_eh_return
2024-04-25 7:34 [Bug target/114846] New: powerpc: epilogue in _Unwind_RaiseException corrupts return value due to __builtin_eh_return pinskia at gcc dot gnu.org
` (15 preceding siblings ...)
2024-06-24 1:49 ` cvs-commit at gcc dot gnu.org
@ 2024-06-24 3:46 ` linkw at gcc dot gnu.org
2024-06-24 3:50 ` linkw at gcc dot gnu.org
17 siblings, 0 replies; 19+ messages in thread
From: linkw at gcc dot gnu.org @ 2024-06-24 3:46 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114846
--- Comment #17 from Kewen Lin <linkw at gcc dot gnu.org> ---
(In reply to Peter Bergner from comment #11)
> Have we done the backports so we can just mark this bug a FIXED? ...or do
> we still need to push the backports?
(In reply to Segher Boessenkool from comment #12)
> The backports have not been done yet.
>
Yeah, I just backported it to all active release branches, previously when I
wanted to backport them, I noticed release 12.4 is ongoing, so I held it for a
while.
> It would be good if the blockage / barrier would get some comment btw, saying
> what exactly it is intended to do! It is very much cargo-cult the way it is.
Good idea, sorry that didn't specify it originally, the reason why adding the
barrier is that: bb verifier requires returnjump_p should be followed by a
barrier:
if (JUMP_P (x)
&& returnjump_p (x) && ! condjump_p (x)
&& ! ((y = next_nonnote_nondebug_insn (x))
&& BARRIER_P (y)))
fatal_insn ("return not followed by barrier", x);
, otherwise we will encounter an ICE. Adding blockage follows the existing
practice when calling rs6000_emit_epilogue to respect option -mno-sched-epilog
(put one scheduling boundary on the emitted insns from rs6000_emit_epilogue).
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug target/114846] powerpc: epilogue in _Unwind_RaiseException corrupts return value due to __builtin_eh_return
2024-04-25 7:34 [Bug target/114846] New: powerpc: epilogue in _Unwind_RaiseException corrupts return value due to __builtin_eh_return pinskia at gcc dot gnu.org
` (16 preceding siblings ...)
2024-06-24 3:46 ` linkw at gcc dot gnu.org
@ 2024-06-24 3:50 ` linkw at gcc dot gnu.org
17 siblings, 0 replies; 19+ messages in thread
From: linkw at gcc dot gnu.org @ 2024-06-24 3:50 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114846
Kewen Lin <linkw at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #18 from Kewen Lin <linkw at gcc dot gnu.org> ---
Should be fixed on trunk and all active release branches.
^ permalink raw reply [flat|nested] 19+ messages in thread