summaryrefslogtreecommitdiff
path: root/gcc/dwarf2cfi.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-02 19:56:29 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-02 19:56:29 +0000
commita5c6cfdd552d418f02546fc4a32275e09a3c44b9 (patch)
tree5e890980807492b4cdd0eb854fdc3823adfefa57 /gcc/dwarf2cfi.c
parent20dc24c25c486eefb434c0e91a1e450233021f34 (diff)
downloadgcc-a5c6cfdd552d418f02546fc4a32275e09a3c44b9.tar.gz
h8300: Generate correct unwind info around swap_into/out_of_er6.
Minimal bug fix is to unset RTX_FRAME_RELATED_P on the PUSH insn generated in h8300_swap_into_er6. But with a tiny bit of effort we can generate real unwind info around the sequence. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177209 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/dwarf2cfi.c')
-rw-r--r--gcc/dwarf2cfi.c29
1 files changed, 11 insertions, 18 deletions
diff --git a/gcc/dwarf2cfi.c b/gcc/dwarf2cfi.c
index 99b37abbff7..69218cb2dfe 100644
--- a/gcc/dwarf2cfi.c
+++ b/gcc/dwarf2cfi.c
@@ -778,8 +778,8 @@ def_cfa_1 (dw_cfa_location *new_cfa)
if (cfi)
{
cur_row->cfa = *new_cfa;
- if (cfi->dw_cfi_opc == DW_CFA_def_cfa_expression)
- cur_row->cfa_cfi = cfi;
+ cur_row->cfa_cfi = (cfi->dw_cfi_opc == DW_CFA_def_cfa_expression
+ ? cfi : NULL);
add_cfi (cfi);
}
@@ -1205,18 +1205,13 @@ dwarf2out_frame_debug_def_cfa (rtx pat)
memset (&loc, 0, sizeof (loc));
- switch (GET_CODE (pat))
+ if (GET_CODE (pat) == PLUS)
{
- case PLUS:
- loc.reg = dwf_regno (XEXP (pat, 0));
loc.offset = INTVAL (XEXP (pat, 1));
- break;
-
- case REG:
- loc.reg = dwf_regno (pat);
- break;
-
- case MEM:
+ pat = XEXP (pat, 0);
+ }
+ if (MEM_P (pat))
+ {
loc.indirect = 1;
pat = XEXP (pat, 0);
if (GET_CODE (pat) == PLUS)
@@ -1224,13 +1219,11 @@ dwarf2out_frame_debug_def_cfa (rtx pat)
loc.base_offset = INTVAL (XEXP (pat, 1));
pat = XEXP (pat, 0);
}
- loc.reg = dwf_regno (pat);
- break;
-
- default:
- /* Recurse and define an expression. */
- gcc_unreachable ();
}
+ /* ??? If this fails, we could be calling into the _loc functions to
+ define a full expression. So far no port does that. */
+ gcc_assert (REG_P (pat));
+ loc.reg = dwf_regno (pat);
def_cfa_1 (&loc);
}