cfgexpand.c (expand_debug_expr): For unused non-addressable parameters passed in...
authorJakub Jelinek <jakub@redhat.com>
Mon, 23 May 2011 17:02:07 +0000 (19:02 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 23 May 2011 17:02:07 +0000 (19:02 +0200)
* cfgexpand.c (expand_debug_expr): For unused non-addressable
parameters passed in memory prefer using DECL_INCOMING_RTL over
the pseudos it will be copied into.

From-SVN: r174079

gcc/ChangeLog
gcc/cfgexpand.c

index 1d46b04b63069fa1a691b1b69e27c365ca7d3eda..eabc32f6cd72e7fd523facefc1d6365053dc4022 100644 (file)
@@ -1,3 +1,9 @@
+2011-05-23  Jakub Jelinek  <jakub@redhat.com>
+
+       * cfgexpand.c (expand_debug_expr): For unused non-addressable
+       parameters passed in memory prefer using DECL_INCOMING_RTL over
+       the pseudos it will be copied into.
+
 2011-05-23  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR target/47315
index ecf2510a0f4e8a302ace82cec9489404cc8be902..b22ba71375f9cdf71bf4bcb27dadd945080b6d87 100644 (file)
@@ -3160,6 +3160,20 @@ expand_debug_expr (tree exp)
                        ENTRY_VALUE_EXP (op0) = incoming;
                        goto adjust_mode;
                      }
+                   if (incoming
+                       && MEM_P (incoming)
+                       && !TREE_ADDRESSABLE (SSA_NAME_VAR (exp))
+                       && GET_MODE (incoming) != BLKmode
+                       && (XEXP (incoming, 0) == virtual_incoming_args_rtx
+                           || (GET_CODE (XEXP (incoming, 0)) == PLUS
+                               && XEXP (XEXP (incoming, 0), 0)
+                                  == virtual_incoming_args_rtx
+                               && CONST_INT_P (XEXP (XEXP (incoming, 0),
+                                                     1)))))
+                     {
+                       op0 = incoming;
+                       goto adjust_mode;
+                     }
                    op0 = expand_debug_expr (SSA_NAME_VAR (exp));
                    if (!op0)
                      return NULL;