http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49982

--- Comment #2 from Richard Henderson <rth at gcc dot gnu.org> 2011-08-05 
15:15:47 UTC ---
Ah, thank you reload for silly intermediate states.  But at least
it gets cleaned up afterward.  So, yes, your fix is correct.

But I'd prefer a slight variation:

diff --git a/gcc/expr.c b/gcc/expr.c
index e5bec34..f170596 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -3631,6 +3631,10 @@ fixup_args_size_notes (rtx prev, rtx last, int
end_args_size)
           && XEXP (SET_SRC (set), 0) == stack_pointer_rtx
           && CONST_INT_P (XEXP (SET_SRC (set), 1)))
         this_delta = INTVAL (XEXP (SET_SRC (set), 1));
+      /* ??? Reload can generate no-op moves, which will be cleaned
+         up later.  Recognize it and continue searching.  */
+      else if (rtx_equal_p (dest, SET_SRC (set)))
+        this_delta = 0;
       else
         saw_unknown = true;
     }

since we tested REGNO and not stack_pointer_rtx earlier.

Reply via email to