aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2011-08-04 15:39:40 +0000
committerRichard Henderson <rth@redhat.com>2011-08-04 15:39:40 +0000
commit40aedd52e8b33cd07c319f916ef0620c43b864a9 (patch)
tree31c68b481009457f22ecf8ae103929ff23f553af
parentd9fd88d826e95881d06cfb12b292e87d6344fd24 (diff)
PR middle-end/49968
* calls.c (expand_call): Use fixup_args_size_notes for emit_stack_restore. * expr.c (fixup_args_size_notes): Allow STACK_POINTER_REGNUM sets in non-standard modes. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@177404 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/calls.c10
-rw-r--r--gcc/expr.c7
3 files changed, 15 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4229c497112..861320b612b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2011-08-04 Richard Henderson <rth@redhat.com>
+
+ PR middle-end/49968
+ * calls.c (expand_call): Use fixup_args_size_notes for
+ emit_stack_restore.
+ * expr.c (fixup_args_size_notes): Allow STACK_POINTER_REGNUM sets
+ in non-standard modes.
+
2011-08-04 Jakub Jelinek <jakub@redhat.com>
* gcc.c (self_spec): New variable.
diff --git a/gcc/calls.c b/gcc/calls.c
index 6eb1f212087..26c320095e0 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -3128,18 +3128,12 @@ expand_call (tree exp, rtx target, int ignore)
if (old_stack_level)
{
- rtx last, set;
+ rtx prev = get_last_insn ();
emit_stack_restore (SAVE_BLOCK, old_stack_level);
stack_pointer_delta = old_stack_pointer_delta;
- /* ??? Is this assert warrented, given emit_stack_restore?
- or should we just mark the last insn no matter what? */
- last = get_last_insn ();
- set = single_set (last);
- gcc_assert (set != NULL);
- gcc_assert (SET_DEST (set) == stack_pointer_rtx);
- add_reg_note (last, REG_ARGS_SIZE, GEN_INT (stack_pointer_delta));
+ fixup_args_size_notes (prev, get_last_insn (), stack_pointer_delta);
pending_stack_adjust = old_pending_adj;
old_stack_allocated = stack_pointer_delta - pending_stack_adjust;
diff --git a/gcc/expr.c b/gcc/expr.c
index 0cfc845c482..e5bec34e78c 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -3620,11 +3620,14 @@ fixup_args_size_notes (rtx prev, rtx last, int end_args_size)
dest = SET_DEST (set);
/* Look for direct modifications of the stack pointer. */
- if (dest == stack_pointer_rtx)
+ if (REG_P (dest) && REGNO (dest) == STACK_POINTER_REGNUM)
{
gcc_assert (!saw_unknown);
/* Look for a trivial adjustment, otherwise assume nothing. */
- if (GET_CODE (SET_SRC (set)) == PLUS
+ /* Note that the SPU restore_stack_block pattern refers to
+ the stack pointer in V4SImode. Consider that non-trivial. */
+ if (SCALAR_INT_MODE_P (GET_MODE (dest))
+ && GET_CODE (SET_SRC (set)) == PLUS
&& XEXP (SET_SRC (set), 0) == stack_pointer_rtx
&& CONST_INT_P (XEXP (SET_SRC (set), 1)))
this_delta = INTVAL (XEXP (SET_SRC (set), 1));