summaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authornickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4>2000-12-22 17:55:09 +0000
committernickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4>2000-12-22 17:55:09 +0000
commit4747ea36f3c48a30809b5a79bcb5f1a0d93c6e4f (patch)
tree16de05acdeb9434ab27a174defa99c3269e05804 /gcc/dwarf2out.c
parent34afc46319a3e760e0a037275e1b4df1856d7f4e (diff)
downloadgcc-4747ea36f3c48a30809b5a79bcb5f1a0d93c6e4f.tar.gz
Allow the (scratch) frame pointer to be initialised from the stack pointer
plus a constant. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38466 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 8c6b6ce5a4b..344fe4d1912 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -1355,16 +1355,27 @@ dwarf2out_frame_debug_expr (expr, label)
}
else
{
- if (GET_CODE (src) != PLUS
- || XEXP (src, 1) != stack_pointer_rtx)
+ if (GET_CODE (src) != PLUS)
abort ();
- if (GET_CODE (XEXP (src, 0)) != REG
- || (unsigned) REGNO (XEXP (src, 0)) != cfa_temp_reg)
- abort ();
- if (cfa.reg != STACK_POINTER_REGNUM)
- abort ();
- cfa_store.reg = REGNO (dest);
- cfa_store.offset = cfa.offset - cfa_temp_value;
+
+ if (GET_CODE (XEXP (src, 0)) == REG
+ && REGNO (XEXP (src, 0)) == cfa.reg
+ && GET_CODE (XEXP (src, 1)) == CONST_INT)
+ /* Setting the FP (or a scratch that will be copied into the FP
+ later on) from SP + const. */
+ cfa.reg = REGNO (dest);
+ else
+ {
+ if (XEXP (src, 1) != stack_pointer_rtx)
+ abort ();
+ if (GET_CODE (XEXP (src, 0)) != REG
+ || (unsigned) REGNO (XEXP (src, 0)) != cfa_temp_reg)
+ abort ();
+ if (cfa.reg != STACK_POINTER_REGNUM)
+ abort ();
+ cfa_store.reg = REGNO (dest);
+ cfa_store.offset = cfa.offset - cfa_temp_value;
+ }
}
break;