This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[df] Always mark the stack pointer as defined on entry.


At the moment, df_get_entry_block_def_set only includes the stack pointer
before prologue and epilogue generation.  I don't see any reason for this.
It's true that the incoming rtl stack pointer does have a different meaning
after prologue generation, but its value is still important.

I noticed this when trying to use DF in md_reorg.  DF_USEs of the
incoming stack pointer were treated as uses of an uninitialised value.
(DF seemed to work fine in this context otherwise, which was nice to see.)

Tested on mips64-linux-gnu and x86_64-linux-gnu.  OK to install?

TBH, the same ought to be true of the static chain pointer,
but that isn't tested by my md_reorg stuff.  I can move it too
if that's preferred.

Richard



	* df-scan.c (df_get_entry_block_def_set): Add STACK_POINTER_REGNUM
	regardless of epilogue_completed.

Index: gcc/df-scan.c
===================================================================
--- gcc/df-scan.c	2008-07-17 21:09:00.000000000 +0100
+++ gcc/df-scan.c	2008-08-23 18:28:30.000000000 +0100
@@ -3681,6 +3681,9 @@ df_get_entry_block_def_set (bitmap entry
 #endif
     }
       
+  /* The always important stack pointer.  */
+  bitmap_set_bit (entry_block_defs, STACK_POINTER_REGNUM);
+
   /* Once the prologue has been generated, all of these registers
      should just show up in the first regular block.  */
   if (HAVE_prologue && epilogue_completed)
@@ -3693,9 +3696,6 @@ df_get_entry_block_def_set (bitmap entry
     }
   else
     {
-      /* The always important stack pointer.  */
-      bitmap_set_bit (entry_block_defs, STACK_POINTER_REGNUM);
-
       /* If STATIC_CHAIN_INCOMING_REGNUM == STATIC_CHAIN_REGNUM
 	 only STATIC_CHAIN_REGNUM is defined.  If they are different,
 	 we only care about the STATIC_CHAIN_INCOMING_REGNUM.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]