aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2001-01-02 20:29:12 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2001-01-02 19:29:12 +0000
commite2134eead7517617e1824633b26560e9b5d09672 (patch)
treec21b4e2869275f5bf36b5068d330ceb1647f34ef
parent2b589241d86c1f2e68d5f2dbceb60f19050bd199 (diff)
downloadgcc-e2134eead7517617e1824633b26560e9b5d09672.zip
gcc-e2134eead7517617e1824633b26560e9b5d09672.tar.gz
gcc-e2134eead7517617e1824633b26560e9b5d09672.tar.bz2
dwarf2out.c (stack_adjust_offset): Handle PRE_MODIFY.
* dwarf2out.c (stack_adjust_offset): Handle PRE_MODIFY. (dwarf2out_frame_debug_expr): Likewise. (mem_loc_descriptor): Handle PRE and POST_MODIFY. From-SVN: r38634
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/dwarf2out.c37
2 files changed, 41 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f64a007..4537c1f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+Tue Jan 2 20:27:07 MET 2001 Jan Hubicka <jh@suse.cz>
+
+ * dwarf2out.c (stack_adjust_offset): Handle PRE_MODIFY.
+ (dwarf2out_frame_debug_expr): Likewise.
+ (mem_loc_descriptor): Handle PRE and POST_MODIFY.
+
Tue Jan 2 20:21:31 MET 2001 Jan Hubicka <jh@suse.cz>
* i386.c (ix86_split_to_parts): Return number of part required;
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index ec47c36..dabf0d1 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -1130,11 +1130,21 @@ stack_adjust_offset (pattern)
src = XEXP (dest, 0);
code = GET_CODE (src);
- if (! (code == PRE_DEC || code == PRE_INC)
+ if (! (code == PRE_DEC || code == PRE_INC
+ || code == PRE_MODIFY)
|| XEXP (src, 0) != stack_pointer_rtx)
return 0;
- offset = GET_MODE_SIZE (GET_MODE (dest));
+ if (code == PRE_MODIFY)
+ {
+ rtx val = XEXP (XEXP (src, 1), 1);
+ /* We handle only adjustments by constant amount. */
+ if (GET_CODE (XEXP (src, 1)) != PLUS ||
+ GET_CODE (val) != CONST_INT)
+ abort();
+ offset = -INTVAL (val);
+ }
+ else offset = GET_MODE_SIZE (GET_MODE (dest));
}
else
return 0;
@@ -1418,6 +1428,21 @@ dwarf2out_frame_debug_expr (expr, label)
switch (GET_CODE (XEXP (dest, 0)))
{
/* With a push. */
+ case PRE_MODIFY:
+ /* We can't handle variable size modifications. */
+ if (GET_CODE (XEXP (XEXP (XEXP (dest, 0), 1), 1)) != CONST_INT)
+ abort();
+ offset = -INTVAL (XEXP (XEXP (XEXP (dest, 0), 1), 1));
+
+ if (REGNO (XEXP (XEXP (dest, 0), 0)) != STACK_POINTER_REGNUM
+ || cfa_store.reg != STACK_POINTER_REGNUM)
+ abort ();
+ cfa_store.offset += offset;
+ if (cfa.reg == STACK_POINTER_REGNUM)
+ cfa.offset = cfa_store.offset;
+
+ offset = -cfa_store.offset;
+ break;
case PRE_INC:
case PRE_DEC:
offset = GET_MODE_SIZE (GET_MODE (dest));
@@ -7590,6 +7615,7 @@ mem_loc_descriptor (rtl, mode)
{
case POST_INC:
case POST_DEC:
+ case POST_MODIFY:
/* POST_INC and POST_DEC can be handled just like a SUBREG. So we
just fall into the SUBREG code. */
@@ -7648,6 +7674,12 @@ mem_loc_descriptor (rtl, mode)
mem_loc_result->dw_loc_oprnd1.v.val_addr = save_rtx (rtl);
break;
+ case PRE_MODIFY:
+ /* Extract the PLUS expression nested inside and fall into
+ PLUS code bellow. */
+ rtl = XEXP (rtl, 1);
+ goto plus;
+
case PRE_INC:
case PRE_DEC:
/* Turn these into a PLUS expression and fall into the PLUS code
@@ -7660,6 +7692,7 @@ mem_loc_descriptor (rtl, mode)
/* Fall through. */
case PLUS:
+ plus:
if (is_based_loc (rtl))
mem_loc_result = based_loc_descr (reg_number (XEXP (rtl, 0)),
INTVAL (XEXP (rtl, 1)));