re PR rtl-optimization/32475 (function with asm() does not setup stack frame)
authorSeongbae Park <seongbae.park@gmail.com>
Thu, 5 Jul 2007 23:44:44 +0000 (23:44 +0000)
committerSeongbae Park <spark@gcc.gnu.org>
Thu, 5 Jul 2007 23:44:44 +0000 (23:44 +0000)
2007-07-05  Seongbae Park  <seongbae.park@gmail.com>

PR rtl-optimization/32475
* df-scan.c (df_def_record_1): Add a use of the stack pointer
for every definition of the stack pointer.

From-SVN: r126391

gcc/ChangeLog
gcc/df-scan.c

index eca91d6..b610717 100644 (file)
@@ -1,3 +1,9 @@
+2007-07-05  Seongbae Park  <seongbae.park@gmail.com>
+
+       PR rtl-optimization/32475
+       * df-scan.c (df_def_record_1): Add a use of the stack pointer
+       for every definition of the stack pointer.
+
 2007-07-05  Richard Earnshaw  <rearnsha@arm.com>
 
        * arm.c (vfp3_const_double_index): Copy signed results of
index 61147be..4a8a1be 100644 (file)
@@ -2763,6 +2763,12 @@ df_def_record_1 (struct df_collection_rec *collection_rec,
       || (GET_CODE (dst) == SUBREG && REG_P (SUBREG_REG (dst))))
     df_ref_record (collection_rec, 
                    dst, loc, bb, insn, DF_REF_REG_DEF, flags);
+
+  /* We want to keep sp alive everywhere - by making all
+     writes to sp also use of sp. */
+  if (REG_P (dst) && REGNO (dst) == STACK_POINTER_REGNUM)
+    df_ref_record (collection_rec,
+               dst, NULL, bb, insn, DF_REF_REG_USE, flags);
 }