]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cfgexpand.c (expand_stack_alignment): Assert that stack_realign_drap and drap_rtx...
authorH.J. Lu <hongjiu.lu@intel.com>
Fri, 1 Aug 2008 16:05:50 +0000 (16:05 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Fri, 1 Aug 2008 16:05:50 +0000 (09:05 -0700)
2008-08-01  H.J. Lu  <hongjiu.lu@intel.com>

* cfgexpand.c (expand_stack_alignment): Assert that
stack_realign_drap and drap_rtx must match.

* function.c (instantiate_new_reg): If DRAP is used to realign
stack, replace virtual_incoming_args_rtx with internal arg
pointer.

From-SVN: r138524

gcc/ChangeLog
gcc/cfgexpand.c
gcc/function.c

index 7b8f8bd66512832b3b7c8308dbe7dd73e50a6f83..51413c0edbc8750cae96462f3808d164fd6ba21a 100644 (file)
@@ -1,3 +1,12 @@
+2008-08-01  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * cfgexpand.c (expand_stack_alignment): Assert that
+       stack_realign_drap and drap_rtx must match.
+
+       * function.c (instantiate_new_reg): If DRAP is used to realign
+       stack, replace virtual_incoming_args_rtx with internal arg
+       pointer.
+
 2008-08-01  Richard Guenther  <rguenther@suse.de>
 
        * tree-ssa-pre.c (fini_pre): Take in_fre parameter.  Free
index c9faa49d4ab4ef2f6db0203179a585086668e878..a943eff6ec1d25c154785e50f1778a77dd294730 100644 (file)
@@ -2226,6 +2226,9 @@ expand_stack_alignment (void)
   gcc_assert (targetm.calls.get_drap_rtx != NULL);
   drap_rtx = targetm.calls.get_drap_rtx (); 
 
+  /* stack_realign_drap and drap_rtx must match.  */
+  gcc_assert ((stack_realign_drap != 0) == (drap_rtx != NULL));
+
   /* Do nothing if NULL is returned, which means DRAP is not needed.  */
   if (NULL != drap_rtx)
     {
index b9d9ec59cc0456f1d3c832f1d5e0c3c54135a251..637775160ebefa2422c699a3a8f6a95f8fd13ccf 100644 (file)
@@ -1215,10 +1215,10 @@ instantiate_new_reg (rtx x, HOST_WIDE_INT *poffset)
 
   if (x == virtual_incoming_args_rtx)
     {
-      /* Replace virtual_incoming_args_rtx to internal arg pointer here */
-      if (crtl->args.internal_arg_pointer != virtual_incoming_args_rtx)
+      if (stack_realign_drap)
         {
-          gcc_assert (stack_realign_drap);
+         /* Replace virtual_incoming_args_rtx with internal arg
+            pointer if DRAP is used to realign stack.  */
           new = crtl->args.internal_arg_pointer;
           offset = 0;
         }