On 1/5/23 06:05, Yoshinori Sato wrote:
Subject:
[PATCH] PR target/89828 Inernal compiler error on -fno-omit-frame-pointer
From:
Yoshinori Sato <ys...@users.sourceforge.jp>
Date:
1/5/23, 06:05
To:
gcc-patches@gcc.gnu.org
CC:
Yoshinori Sato <ys...@users.sourceforge.jp>
The problem was caused by an erroneous note about creating a stack frame,
which caused the cur_cfa reg to fail to assert with a value other than
the frame pointer.
This fix will generate notes that correctly update cur_cfa.
gcc/config/rx/
* rx.cc (add_pop_cfi_notes): Release the frame pointer if it is used.
(rx_expand_prologue): Redesigned stack pointer and frame pointer update
process.
This seems to be taking a step backwards in that it's causing multiple
internal errors when compiling newlib.
The failures are here:
static void
dwarf2out_frame_debug_adjust_cfa (rtx pat)
{
rtx src, dest;
gcc_assert (GET_CODE (pat) == SET);
dest = XEXP (pat, 0);
src = XEXP (pat, 1);
switch (GET_CODE (src))
{
case PLUS:
gcc_assert (cur_cfa->reg == XEXP (src, 0));
cur_cfa->offset -= rtx_to_poly_int64 (XEXP (src, 1));
break;
case REG:
break;
default:
gcc_unreachable ();
}
cur_cfa->reg = dwf_cfa_reg (dest);
gcc_assert (cur_cfa->indirect == 0);
}
In particular it's tripping the gcc_assert in the PLUS case above.
Which is a pretty good indicator the contents of the note and the insn's
pattern are different WRT the expected registers.
jeff