diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2024-10-29 21:40:34 +0100 |
---|---|---|
committer | Eric Botcazou <ebotcazou@adacore.com> | 2024-10-29 21:43:59 +0100 |
commit | 7211155732244ac527c075d033164ec253ee0971 (patch) | |
tree | 657c37c90f09a64b81b256cc514f8271d1504b81 /gcc/fortran/error.cc | |
parent | 9dd9a88b75334bc079b8ab5fb2dbb5d56765bd60 (diff) | |
download | gcc-7211155732244ac527c075d033164ec253ee0971.zip gcc-7211155732244ac527c075d033164ec253ee0971.tar.gz gcc-7211155732244ac527c075d033164ec253ee0971.tar.bz2 |
Fix miscompilation of function containing __builtin_unreachable
This is a wrong-code generation on the SPARC for a function containing
a call to __builtin_unreachable caused by the delay slot scheduling pass,
and more specifically the find_end_label function which has these lines:
/* Otherwise, see if there is a label at the end of the function. If there
is, it must be that RETURN insns aren't needed, so that is our return
label and we don't have to do anything else. */
The comment was correct 20 years ago but no longer is nowadays in the
presence of RTL epilogues and calls to __builtin_unreachable, so the
patch just removes the associated two lines of code:
else if (LABEL_P (insn))
*plabel = as_a <rtx_code_label *> (insn);
and otherwise contains just adjustments to the commentary.
gcc/
PR rtl-optimization/117327
* reorg.cc (find_end_label): Do not return a dangling label at the
end of the function and adjust commentary.
gcc/testsuite/
* gcc.c-torture/execute/20241029-1.c: New test.
Diffstat (limited to 'gcc/fortran/error.cc')
0 files changed, 0 insertions, 0 deletions