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]

[PATCH] Support no stripping of subregs in df.c


For a patch I am working on, I need to ask df.c to return all subregs. This very simple patch adds the infrastructure.

Ok for mainline?

Paolo
2005-05-13  Paolo Bonzini  <bonzini@gnu.org>

	* df.c (df_ref_record): Never strip subregs if DF_SUBREGS is set.
	* df.h (DF_SUBREGS): New.

Index: df.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/df.c,v
retrieving revision 1.84
diff -p -u -r1.84 df.c
--- df.c	17 Feb 2005 16:19:27 -0000	1.84
+++ df.c	13 May 2005 08:16:47 -0000
@@ -820,7 +820,8 @@ df_ref_record (struct df *df, rtx reg, r
      reg.  As written in the docu those should have the form
      (subreg:SI (reg:M A) N), with size(SImode) > size(Mmode).
      XXX Is that true?  We could also use the global word_mode variable.  */
-  if (GET_CODE (reg) == SUBREG
+  if ((df->flags & DF_SUBREGS) == 0
+      && GET_CODE (reg) == SUBREG
       && (GET_MODE_SIZE (GET_MODE (reg)) < GET_MODE_SIZE (word_mode)
 	  || GET_MODE_SIZE (GET_MODE (reg))
 	       >= GET_MODE_SIZE (GET_MODE (SUBREG_REG (reg)))))
Index: df.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/df.h,v
retrieving revision 1.32
diff -p -u -r1.32 df.h
--- df.h	10 Feb 2005 18:46:31 -0000	1.32
+++ df.h	13 May 2005 08:16:47 -0000
@@ -38,6 +38,7 @@ Software Foundation, 59 Temple Place - S
 #define DF_ALL		255
 #define DF_HARD_REGS	1024	/* Mark hard registers.  */
 #define DF_EQUIV_NOTES	2048	/* Mark uses present in EQUIV/EQUAL notes.  */
+#define DF_SUBREGS	4096	/* Return subregs rather than the inner reg.  */
 
 enum df_ref_type {DF_REF_REG_DEF, DF_REF_REG_USE, DF_REF_REG_MEM_LOAD,
 		  DF_REF_REG_MEM_STORE};

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