[PATCH] half pic removal

Eric Christopher echristo@redhat.com
Mon Jun 10 12:43:00 GMT 2002


On Mon, 2002-06-10 at 12:34, Richard Henderson wrote:
> On Mon, Jun 10, 2002 at 12:23:40PM -0700, Eric Christopher wrote:
> > How odd. It never actually included halfpic.h. Anyhow, while deleting it
> > I noticed a bunch of stuff that is dependent on #ifdef OSF_OS, which
> > afaict, is never defined anywhere. Would you like that to go away while
> > I'm at it?
> 
> Please.
> 
> > There's also i386-interix.h...
> 
> In theory that's still live.

OK.

The rest is done as such.

OK?

-eric

-- 
I will not carve gods

2002-06-10  Eric Christopher  <echristo@redhat.com>

	* config/i386/i386.c (ix86_osf_output_function_prologue): Remove
	prototype and function.
	(TARGET_ASM_FUNCTION_PROLOGUE): Remove OSF version.
	(call_insn_operand): Remove half pic references.
	(legitimate_address_p): Ditto.
	* config/i386/i386.h: Remove half pic defines.

Index: i386.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.419
diff -u -p -w -r1.419 i386.c
--- i386.c	4 Jun 2002 07:08:58 -0000	1.419
+++ i386.c	10 Jun 2002 19:39:36 -0000
@@ -801,12 +801,6 @@ static enum x86_64_reg_class merge_class
 #undef TARGET_EXPAND_BUILTIN
 #define TARGET_EXPAND_BUILTIN ix86_expand_builtin
 
-#if defined (OSF_OS) || defined (TARGET_OSF1ELF)
-   static void ix86_osf_output_function_prologue PARAMS ((FILE *,
-							  HOST_WIDE_INT));
-#  undef TARGET_ASM_FUNCTION_PROLOGUE
-#  define TARGET_ASM_FUNCTION_PROLOGUE ix86_osf_output_function_prologue
-#endif
 #undef TARGET_ASM_FUNCTION_EPILOGUE
 #define TARGET_ASM_FUNCTION_EPILOGUE ix86_output_function_epilogue
 
@@ -1354,105 +1348,6 @@ ix86_handle_regparm_attribute (node, nam
   return NULL_TREE;
 }
 
-#if defined (OSF_OS) || defined (TARGET_OSF1ELF)
-
-/* Generate the assembly code for function entry.  FILE is a stdio
-   stream to output the code to.  SIZE is an int: how many units of
-   temporary storage to allocate.
-
-   Refer to the array `regs_ever_live' to determine which registers to
-   save; `regs_ever_live[I]' is nonzero if register number I is ever
-   used in the function.  This function is responsible for knowing
-   which registers should not be saved even if used.
-
-   We override it here to allow for the new profiling code to go before
-   the prologue and the old mcount code to go after the prologue (and
-   after %ebx has been set up for ELF shared library support).  */
-
-static void
-ix86_osf_output_function_prologue (file, size)
-     FILE *file;
-     HOST_WIDE_INT size;
-{
-  const char *prefix = "";
-  const char *const lprefix = LPREFIX;
-  int labelno = current_function_profile_label_no;
-
-#ifdef OSF_OS
-
-  if (TARGET_UNDERSCORES)
-    prefix = "_";
-
-  if (current_function_profile && OSF_PROFILE_BEFORE_PROLOGUE)
-    {
-      if (!flag_pic && !HALF_PIC_P ())
-	{
-	  fprintf (file, "\tmovl $%sP%d,%%edx\n", lprefix, labelno);
-	  fprintf (file, "\tcall *%s_mcount_ptr\n", prefix);
-	}
-
-      else if (HALF_PIC_P ())
-	{
-	  rtx symref;
-
-	  HALF_PIC_EXTERNAL ("_mcount_ptr");
-	  symref = HALF_PIC_PTR (gen_rtx_SYMBOL_REF (Pmode,
-						     "_mcount_ptr"));
-
-	  fprintf (file, "\tmovl $%sP%d,%%edx\n", lprefix, labelno);
-	  fprintf (file, "\tmovl %s%s,%%eax\n", prefix,
-		   XSTR (symref, 0));
-	  fprintf (file, "\tcall *(%%eax)\n");
-	}
-
-      else
-	{
-	  static int call_no = 0;
-
-	  fprintf (file, "\tcall %sPc%d\n", lprefix, call_no);
-	  fprintf (file, "%sPc%d:\tpopl %%eax\n", lprefix, call_no);
-	  fprintf (file, "\taddl $_GLOBAL_OFFSET_TABLE_+[.-%sPc%d],%%eax\n",
-		   lprefix, call_no++);
-	  fprintf (file, "\tleal %sP%d@GOTOFF(%%eax),%%edx\n",
-		   lprefix, labelno);
-	  fprintf (file, "\tmovl %s_mcount_ptr@GOT(%%eax),%%eax\n",
-		   prefix);
-	  fprintf (file, "\tcall *(%%eax)\n");
-	}
-    }
-
-#else  /* !OSF_OS */
-
-  if (current_function_profile && OSF_PROFILE_BEFORE_PROLOGUE)
-    {
-      if (!flag_pic)
-	{
-	  fprintf (file, "\tmovl $%sP%d,%%edx\n", lprefix, labelno);
-	  fprintf (file, "\tcall *%s_mcount_ptr\n", prefix);
-	}
-
-      else
-	{
-	  static int call_no = 0;
-
-	  fprintf (file, "\tcall %sPc%d\n", lprefix, call_no);
-	  fprintf (file, "%sPc%d:\tpopl %%eax\n", lprefix, call_no);
-	  fprintf (file, "\taddl $_GLOBAL_OFFSET_TABLE_+[.-%sPc%d],%%eax\n",
-		   lprefix, call_no++);
-	  fprintf (file, "\tleal %sP%d@GOTOFF(%%eax),%%edx\n",
-		   lprefix, labelno);
-	  fprintf (file, "\tmovl %s_mcount_ptr@GOT(%%eax),%%eax\n",
-		   prefix);
-	  fprintf (file, "\tcall *(%%eax)\n");
-	}
-    }
-#endif /* !OSF_OS */
-
-  function_prologue (file, size);
-}
-
-#endif  /* OSF_OS || TARGET_OSF1ELF */
-
 /* Return 0 if the attributes for two types are incompatible, 1 if they
    are compatible, and 2 if they are nearly compatible (which causes a
    warning to be generated).  */
@@ -3139,11 +3034,6 @@ call_insn_operand (op, mode)
   if (GET_CODE (op) == SYMBOL_REF)
     return 1;
 
-  /* Half-pic doesn't allow anything but registers and constants.
-     We've just taken care of the later.  */
-  if (HALF_PIC_P ())
-    return register_operand (op, Pmode);
-
   /* Otherwise we can allow any general_operand in the address.  */
   return general_operand (op, Pmode);
 }
@@ -5291,15 +5181,6 @@ legitimate_address_p (mode, addr, strict
 	     that never results in lea, this seems to be easier and
 	     correct fix for crash to disable this test.  */
 	}
-      else if (HALF_PIC_P ())
-	{
-	  if (! HALF_PIC_ADDRESS_P (disp)
-	      || (base != NULL_RTX || index != NULL_RTX))
-	    {
-	      reason = "displacement is an invalid half-pic reference";
-	      goto report_error;
-	    }
-	}
       else if (!CONSTANT_ADDRESS_P (disp))
 	{
 	  reason = "displacement is not constant";
Index: i386.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.h,v
retrieving revision 1.268
diff -u -p -w -r1.268 i386.h
--- i386.h	4 Jun 2002 18:07:38 -0000	1.268
+++ i386.h	10 Jun 2002 19:39:37 -0000
@@ -34,20 +34,6 @@ Boston, MA 02111-1307, USA.  */
    ADDR_BEG, ADDR_END, PRINT_IREG, PRINT_SCALE, PRINT_B_I_S, and many
    that start with ASM_ or end in ASM_OP.  */
 
-/* Stubs for half-pic support if not OSF/1 reference platform.  */
-
-#ifndef HALF_PIC_P
-#define HALF_PIC_P() 0
-#define HALF_PIC_NUMBER_PTRS 0
-#define HALF_PIC_NUMBER_REFS 0
-#define HALF_PIC_ENCODE(DECL)
-#define HALF_PIC_DECLARE(NAME)
-#define HALF_PIC_INIT()	error ("half-pic init called on systems that don't support it")
-#define HALF_PIC_ADDRESS_P(X) 0
-#define HALF_PIC_PTR(X) (X)
-#define HALF_PIC_FINISH(STREAM)
-#endif
-
 /* Define the specific costs for a given cpu */
 
 struct processor_costs {



More information about the Gcc-patches mailing list