aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@acm.org>2008-10-21 18:06:12 +0000
committerBob Wilson <bwilson@gcc.gnu.org>2008-10-21 18:06:12 +0000
commit7d4074339038e21d9bfc7656b5ed8db4b5c57f01 (patch)
tree2177c51ed2d72409e3256ff49607c4af9cfd3328
parentcd6d4007aa4f72b51756e4a571abf876fa3e3133 (diff)
downloadgcc-7d4074339038e21d9bfc7656b5ed8db4b5c57f01.zip
gcc-7d4074339038e21d9bfc7656b5ed8db4b5c57f01.tar.gz
gcc-7d4074339038e21d9bfc7656b5ed8db4b5c57f01.tar.bz2
var-tracking.c (insn_stack_adjust_offset_pre_post): If insn has a REG_FRAME_RELATED_EXPR note...
* var-tracking.c (insn_stack_adjust_offset_pre_post): If insn has a REG_FRAME_RELATED_EXPR note, examine the pattern from the note instead of from insn. From-SVN: r141272
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/var-tracking.c25
2 files changed, 23 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2400d99..cf00fef 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2008-10-21 Bob Wilson <bob.wilson@acm.org>
+
+ * var-tracking.c (insn_stack_adjust_offset_pre_post): If insn has a
+ REG_FRAME_RELATED_EXPR note, examine the pattern from the note instead
+ of from insn.
+
2008-10-21 Adam Nemet <anemet@caviumnetworks.com>
PR middle-end/37669
diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c
index ab4d93c..2b92e40 100644
--- a/gcc/var-tracking.c
+++ b/gcc/var-tracking.c
@@ -466,22 +466,31 @@ static void
insn_stack_adjust_offset_pre_post (rtx insn, HOST_WIDE_INT *pre,
HOST_WIDE_INT *post)
{
+ rtx pattern;
+
*pre = 0;
*post = 0;
- if (GET_CODE (PATTERN (insn)) == SET)
- stack_adjust_offset_pre_post (PATTERN (insn), pre, post);
- else if (GET_CODE (PATTERN (insn)) == PARALLEL
- || GET_CODE (PATTERN (insn)) == SEQUENCE)
+ pattern = PATTERN (insn);
+ if (RTX_FRAME_RELATED_P (insn))
+ {
+ rtx expr = find_reg_note (insn, REG_FRAME_RELATED_EXPR, NULL_RTX);
+ if (expr)
+ pattern = XEXP (expr, 0);
+ }
+
+ if (GET_CODE (pattern) == SET)
+ stack_adjust_offset_pre_post (pattern, pre, post);
+ else if (GET_CODE (pattern) == PARALLEL
+ || GET_CODE (pattern) == SEQUENCE)
{
int i;
/* There may be stack adjustments inside compound insns. Search
for them. */
- for ( i = XVECLEN (PATTERN (insn), 0) - 1; i >= 0; i--)
- if (GET_CODE (XVECEXP (PATTERN (insn), 0, i)) == SET)
- stack_adjust_offset_pre_post (XVECEXP (PATTERN (insn), 0, i),
- pre, post);
+ for ( i = XVECLEN (pattern, 0) - 1; i >= 0; i--)
+ if (GET_CODE (XVECEXP (pattern, 0, i)) == SET)
+ stack_adjust_offset_pre_post (XVECEXP (pattern, 0, i), pre, post);
}
}