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]

Death to #ifdefs - LEGITIMATE_PIC_OPERAND_P


This patch adds a defaults.h definition of LEGITIMATE_PIC_OPERAND_P
and removes all the thus-unnecessary #ifdefs.  This macro is ripe for
conversion to a target hook but I don't feel that ambitious right now.

Bootstrapped amd64-linux.

zw

        * defaults.h (LEGITIMATE_PIC_OPERAND_P): Provide default definition.
        * recog.c (general_operand, immediate_operand, nonmemory_operand)
        (asm_operand_ok): Remove #ifdefs on LEGITIMATE_PICOPERAND_P.
        * regclass.c (record_reg_classes): Likewise.
        * reload.c (find_reloads): Likewise.
        * reload1.c (reload): Likewise.

===================================================================
Index: defaults.h
--- defaults.h	25 Jul 2004 22:17:02 -0000	1.141
+++ defaults.h	3 Aug 2004 23:23:23 -0000
@@ -768,6 +768,10 @@ You Lose!  You must define PREFERRED_DEB
 #define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN)
 #endif
 
+#ifndef LEGITIMATE_PIC_OPERAND_P
+#define LEGITIMATE_PIC_OPERAND_P(X) 1
+#endif
+
 #ifndef REVERSIBLE_CC_MODE
 #define REVERSIBLE_CC_MODE(MODE) 0
 #endif
===================================================================
Index: recog.c
--- recog.c	25 Jul 2004 17:57:23 -0000	1.207
+++ recog.c	3 Aug 2004 23:23:23 -0000
@@ -922,9 +922,7 @@ general_operand (rtx op, enum machine_mo
   if (CONSTANT_P (op))
     return ((GET_MODE (op) == VOIDmode || GET_MODE (op) == mode
 	     || mode == VOIDmode)
-#ifdef LEGITIMATE_PIC_OPERAND_P
 	    && (! flag_pic || LEGITIMATE_PIC_OPERAND_P (op))
-#endif
 	    && LEGITIMATE_CONSTANT_P (op));
 
   /* Except for certain constants with VOIDmode, already checked for,
@@ -1102,9 +1100,7 @@ immediate_operand (rtx op, enum machine_
   return (CONSTANT_P (op)
 	  && (GET_MODE (op) == mode || mode == VOIDmode
 	      || GET_MODE (op) == VOIDmode)
-#ifdef LEGITIMATE_PIC_OPERAND_P
 	  && (! flag_pic || LEGITIMATE_PIC_OPERAND_P (op))
-#endif
 	  && LEGITIMATE_CONSTANT_P (op));
 }
 
@@ -1170,9 +1166,7 @@ nonmemory_operand (rtx op, enum machine_
 
       return ((GET_MODE (op) == VOIDmode || GET_MODE (op) == mode
 	       || mode == VOIDmode)
-#ifdef LEGITIMATE_PIC_OPERAND_P
 	      && (! flag_pic || LEGITIMATE_PIC_OPERAND_P (op))
-#endif
 	      && LEGITIMATE_CONSTANT_P (op));
     }
 
@@ -1677,11 +1671,7 @@ asm_operand_ok (rtx op, const char *cons
 	  /* Fall through.  */
 
 	case 'i':
-	  if (CONSTANT_P (op)
-#ifdef LEGITIMATE_PIC_OPERAND_P
-	      && (! flag_pic || LEGITIMATE_PIC_OPERAND_P (op))
-#endif
-	      )
+	  if (CONSTANT_P (op) && (! flag_pic || LEGITIMATE_PIC_OPERAND_P (op)))
 	    result = 1;
 	  break;
 
===================================================================
Index: regclass.c
--- regclass.c	22 Jul 2004 08:20:35 -0000	1.191
+++ regclass.c	3 Aug 2004 23:23:23 -0000
@@ -1614,10 +1614,7 @@ record_reg_classes (int n_alts, int n_op
 		    break;
 		case 'i':
 		  if (CONSTANT_P (op)
-#ifdef LEGITIMATE_PIC_OPERAND_P
-		      && (! flag_pic || LEGITIMATE_PIC_OPERAND_P (op))
-#endif
-		      )
+		      && (! flag_pic || LEGITIMATE_PIC_OPERAND_P (op)))
 		    win = 1;
 		  break;
 
@@ -1648,10 +1645,7 @@ record_reg_classes (int n_alts, int n_op
 		case 'g':
 		  if (MEM_P (op)
 		      || (CONSTANT_P (op)
-#ifdef LEGITIMATE_PIC_OPERAND_P
-			  && (! flag_pic || LEGITIMATE_PIC_OPERAND_P (op))
-#endif
-			  ))
+			  && (! flag_pic || LEGITIMATE_PIC_OPERAND_P (op))))
 		    win = 1;
 		  allows_mem[i] = 1;
 		case 'r':
===================================================================
Index: reload.c
--- reload.c	9 Jul 2004 03:29:34 -0000	1.246
+++ reload.c	3 Aug 2004 23:23:23 -0000
@@ -3228,10 +3228,7 @@ find_reloads (rtx insn, int replace, int
 		  break;
 	      case 'i':
 		if (CONSTANT_P (operand)
-#ifdef LEGITIMATE_PIC_OPERAND_P
-		    && (! flag_pic || LEGITIMATE_PIC_OPERAND_P (operand))
-#endif
-		    )
+		    && (! flag_pic || LEGITIMATE_PIC_OPERAND_P (operand)))
 		  win = 1;
 		break;
 
@@ -3266,11 +3263,9 @@ find_reloads (rtx insn, int replace, int
 		    && GET_CODE (operand) != PLUS
 		    /* A SCRATCH is not a valid operand.  */
 		    && GET_CODE (operand) != SCRATCH
-#ifdef LEGITIMATE_PIC_OPERAND_P
 		    && (! CONSTANT_P (operand)
 			|| ! flag_pic
 			|| LEGITIMATE_PIC_OPERAND_P (operand))
-#endif
 		    && (GENERAL_REGS == ALL_REGS
 			|| !REG_P (operand)
 			|| (REGNO (operand) >= FIRST_PSEUDO_REGISTER
===================================================================
Index: reload1.c
--- reload1.c	9 Jul 2004 03:29:34 -0000	1.441
+++ reload1.c	3 Aug 2004 23:23:24 -0000
@@ -734,16 +734,13 @@ reload (rtx first, int global)
 	{
 	  rtx note = find_reg_note (insn, REG_EQUIV, NULL_RTX);
 	  if (note
-#ifdef LEGITIMATE_PIC_OPERAND_P
 	      && (! function_invariant_p (XEXP (note, 0))
 		  || ! flag_pic
 		  /* A function invariant is often CONSTANT_P but may
 		     include a register.  We promise to only pass
 		     CONSTANT_P objects to LEGITIMATE_PIC_OPERAND_P.  */
 		  || (CONSTANT_P (XEXP (note, 0))
-		      && LEGITIMATE_PIC_OPERAND_P (XEXP (note, 0))))
-#endif
-	      )
+		      && LEGITIMATE_PIC_OPERAND_P (XEXP (note, 0)))))
 	    {
 	      rtx x = XEXP (note, 0);
 	      i = REGNO (SET_DEST (set));


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