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]

b-i-b: delete vax-vms support


This patch for the 3.4 basic improvements branch deletes the support for
VAX-VMS (several *hundred* lines).  Everything deleted here was only used for 
vax-vms targets or vax-vms hosts.  It's not clear that either actually worked.

I don't know if it's suitable for this branch, but since VAX-VMS
is being declared obselete in 3.3, it's supposed to be removed in 3.4 unless
someone shows up -- so I figured it was worth a try.

Note that two files are deleted entirely.

I'm actually not even sure I got everything; this was a very conservative
change.  My hope is that the VAX maintainers will be able to look at the
now-much-simpler files and make the sort of updates to modern practices
which have been made for other machines.

2002-09-21  Nathanael Nerode  <neroden@gcc.gnu.org>

	* config.gcc: Remove support for vax-*-vms*.
	* config/vax/vms.h: Remove.
	* config/vax/xm-vms.h: Remove.
	* config/vax/vax-protos.h: Remove VMS-specific code.
	* config/vax/vax.c: Remove VMS-specific code.

Index: config.gcc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config.gcc,v
retrieving revision 1.240.2.2
diff -u -3 -r1.240.2.2 config.gcc
--- config.gcc	17 Sep 2002 22:58:38 -0000	1.240.2.2
+++ config.gcc	21 Sep 2002 20:55:17 -0000
@@ -219,7 +219,6 @@
  | mn10200-*-*      \
  | ns32k-*-openbsd* \
  | romp-*-openbsd*  \
- | vax-*-vms* \
  )
     if test "x$enable_obsolete" != xyes; then
       echo "*** Configuration $machine is obsolete." >&2
@@ -2624,8 +2623,8 @@
 	tm_file="${tm_file} vax/ultrix.h"
 	;;
 vax-*-vms*)			# VAXen running VMS
-	xm_file=vax/xm-vms.h
-	tm_file=vax/vms.h
+	echo "Configuration $machine no longer supported" 1>&2
+	exit 1
 	;;
 vax-*-*)			# VAX default entry
 	;;
Index: config/vax/vax-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/vax/vax-protos.h,v
retrieving revision 1.4
diff -u -3 -r1.4 vax-protos.h
--- config/vax/vax-protos.h	16 Nov 2001 22:40:21 -0000	1.4
+++ config/vax/vax-protos.h	21 Sep 2002 20:55:24 -0000
@@ -32,9 +32,4 @@
 extern int check_float_value PARAMS ((enum machine_mode, REAL_VALUE_TYPE *, int));
 #endif /* REAL_VALUE_TYPE */
 
-#ifdef TREE_CODE
-extern void vms_check_external PARAMS ((tree, const char *, int));
-#endif /* TREE_CODE */
-
-extern void vms_flush_pending_externals PARAMS ((FILE *));
 extern void const_section PARAMS ((void));
Index: config/vax/vax.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/vax/vax.c,v
retrieving revision 1.29.2.2
diff -u -3 -r1.29.2.2 vax.c
--- config/vax/vax.c	20 Sep 2002 01:29:24 -0000	1.29.2.2
+++ config/vax/vax.c	21 Sep 2002 20:55:24 -0000
@@ -40,13 +40,6 @@
 
 static int follows_p PARAMS ((rtx, rtx));
 static void vax_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
-#if VMS_TARGET
-static void vms_asm_out_constructor PARAMS ((rtx, int));
-static void vms_asm_out_destructor PARAMS ((rtx, int));
-static void vms_select_section PARAMS ((tree, int, unsigned HOST_WIDE_INT));
-static void vms_encode_section_info PARAMS ((tree, int));
-static void vms_globalize_label PARAMS ((FILE *, const char *));
-#endif
 
 /* Initialize the GCC target structure.  */
 #undef TARGET_ASM_ALIGNED_HI_OP
@@ -55,15 +48,6 @@
 #undef TARGET_ASM_FUNCTION_PROLOGUE
 #define TARGET_ASM_FUNCTION_PROLOGUE vax_output_function_prologue
 
-#if VMS_TARGET
-#undef TARGET_ASM_SELECT_SECTION
-#define TARGET_ASM_SELECT_SECTION vms_select_section
-#undef TARGET_ENCODE_SECTION_INFO
-#define TARGET_ENCODE_SECTION_INFO vms_encode_section_info
-#undef TARGET_ASM_GLOBALIZE_LABEL
-#define TARGET_ASM_GLOBALIZE_LABEL vms_globalize_label
-#endif
-
 struct gcc_target targetm = TARGET_INITIALIZER;
 
 /* Generate the assembly code for function entry.  FILE is a stdio
@@ -89,44 +73,6 @@
 
   fprintf (file, "\t.word 0x%x\n", mask);
 
-  if (VMS_TARGET)
-    {
-      /*
-       * This works for both gcc and g++.  It first checks to see if
-       * the current routine is "main", which will only happen for
-       * GCC, and add the jsb if it is.  If is not the case then try
-       * and see if __MAIN_NAME is part of current_function_name,
-       * which will only happen if we are running g++, and add the jsb
-       * if it is.  In gcc there should never be a paren in the
-       * function name, and in g++ there is always a "(" in the
-       * function name, thus there should never be any confusion.
-       *
-       * Adjusting the stack pointer by 4 before calling C$MAIN_ARGS
-       * is required when linking with the VMS POSIX version of the C
-       * run-time library; using `subl2 $4,r0' is adequate but we use
-       * `clrl -(sp)' instead.  The extra 4 bytes could be removed
-       * after the call because STARTING_FRAME_OFFSET's setting of -4
-       * will end up adding them right back again, but don't bother.
-       */
-
-      const char *p = current_function_name;
-      int is_main = strcmp ("main", p) == 0;
-#     define __MAIN_NAME " main("
-
-      while (!is_main && *p != '\0')
-	{
-	  if (*p == *__MAIN_NAME
-	      && strncmp (p, __MAIN_NAME, sizeof __MAIN_NAME - sizeof "") == 0)
-	    is_main = 1;
-	  else
-	    p++;
-	}
-
-      if (is_main)
-	fprintf (file, "\tclrl -(%ssp)\n\tjsb _C$MAIN_ARGS\n",
-	         REGISTER_PREFIX);
-    }
-
   size -= STARTING_FRAME_OFFSET;
   if (size >= 64)
     fprintf (file, "\tmovab %d(%ssp),%ssp\n", -size, REGISTER_PREFIX,
@@ -697,265 +643,6 @@
   return c;
 }
 
-#if VMS_TARGET
-/* Additional support code for VMS target.  */
-
-/* Linked list of all externals that are to be emitted when optimizing
-   for the global pointer if they haven't been declared by the end of
-   the program with an appropriate .comm or initialization.  */
-
-static
-struct extern_list {
-  struct extern_list *next;	/* next external */
-  const char *name;		/* name of the external */
-  int size;			/* external's actual size */
-  int in_const;			/* section type flag */
-} *extern_head = 0, *pending_head = 0;
-
-/* Check whether NAME is already on the external definition list.  If not,
-   add it to either that list or the pending definition list.  */
-
-void
-vms_check_external (decl, name, pending)
-     tree decl;
-     const char *name;
-     int pending;
-{
-  register struct extern_list *p, *p0;
-
-  for (p = extern_head; p; p = p->next)
-    if (!strcmp (p->name, name))
-      return;
-
-  for (p = pending_head, p0 = 0; p; p0 = p, p = p->next)
-    if (!strcmp (p->name, name))
-      {
-	if (pending)
-	  return;
-
-	/* Was pending, but has now been defined; move it to other list.  */
-	if (p == pending_head)
-	  pending_head = p->next;
-	else
-	  p0->next = p->next;
-	p->next = extern_head;
-	extern_head = p;
-	return;
-      }
-
-  /* Not previously seen; create a new list entry.  */
-  p = (struct extern_list *) xmalloc (sizeof (struct extern_list));
-  p->name = name;
-
-  if (pending)
-    {
-      /* Save the size and section type and link to `pending' list.  */
-      p->size = (DECL_SIZE (decl) == 0) ? 0 :
-	TREE_INT_CST_LOW (size_binop (CEIL_DIV_EXPR, DECL_SIZE (decl),
-				      size_int (BITS_PER_UNIT)));
-      p->in_const = (TREE_READONLY (decl) && ! TREE_THIS_VOLATILE (decl));
-
-      p->next = pending_head;
-      pending_head = p;
-    }
-  else
-    {
-      /* Size and section type don't matter; link to `declared' list.  */
-      p->size = p->in_const = 0;        /* arbitrary init */
-
-      p->next = extern_head;
-      extern_head = p;
-    }
-  return;
-}
-
-void
-vms_flush_pending_externals (file)
-     FILE *file;
-{
-  register struct extern_list *p;
-
-  while (pending_head)
-    {
-      /* Move next pending declaration to the "done" list.  */
-      p = pending_head;
-      pending_head = p->next;
-      p->next = extern_head;
-      extern_head = p;
-
-      /* Now output the actual declaration.  */
-      if (p->in_const)
-	const_section ();
-      else
-	data_section ();
-      fputs (".comm ", file);
-      assemble_name (file, p->name);
-      fprintf (file, ",%d\n", p->size);
-    }
-}
-
-static void
-vms_asm_out_constructor (symbol, priority)
-     rtx symbol;
-     int priority ATTRIBUTE_UNUSED;
-{
-  fprintf (asm_out_file,".globl $$PsectAttributes_NOOVR$$__gxx_init_1\n");
-  data_section();
-  fprintf (asm_out_file,"$$PsectAttributes_NOOVR$$__gxx_init_1:\n\t.long\t");
-  assemble_name (asm_out_file, XSTR (symbol, 0));
-  fputc ('\n', asm_out_file);
-}
-
-static void
-vms_asm_out_destructor (symbol, priority)
-     rtx symbol;
-     int priority ATTRIBUTE_UNUSED;
-{
-  fprintf (asm_out_file,".globl $$PsectAttributes_NOOVR$$__gxx_clean_1\n");
-  data_section();
-  fprintf (asm_out_file,"$$PsectAttributes_NOOVR$$__gxx_clean_1:\n\t.long\t");
-  assemble_name (asm_out_file, XSTR (symbol, 0));
-  fputc ('\n', asm_out_file);
-}
-
-static void
-vms_select_section (exp, reloc, align)
-     tree exp;
-     int reloc ATTRIBUTE_UNUSED;
-     unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED;
-{
-  if (TREE_CODE (exp) == VAR_DECL)
-    {
-      if (TREE_READONLY (exp) && ! TREE_THIS_VOLATILE (exp)
-	  && DECL_INITIAL (exp)
-	  && (DECL_INITIAL (exp) == error_mark_node
-	      || TREE_CONSTANT (DECL_INITIAL (exp))))
-	{
-	  if (TREE_PUBLIC (exp))
-	    const_section ();
-	  else
-	    text_section ();
-	}
-      else
-	data_section ();
-    }
-  if (TREE_CODE_CLASS (TREE_CODE (exp)) == 'c')
-    {
-      if (TREE_CODE (exp) == STRING_CST && flag_writable_strings)
-	data_section ();
-      else
-	text_section ();
-    }
-}
-
-/* Make sure that external variables are correctly addressed.  Under VMS
-   there is some brain damage in the linker that requires us to do this.  */
-
-static void
-vms_encode_section_info (decl, first)
-     tree decl;
-     int first ATTRIBUTE_UNUSED;
-{
-  if (DECL_EXTERNAL (decl) && TREE_PUBLIC (decl))
-    SYMBOL_REF_FLAG (XEXP (DECL_RTL (decl), 0)) = 1;
-}
-
-/* This is how to output a command to make the user-level label named NAME
-   defined for reference from other files.  */
-static void
-vms_globalize_label (stream, name)
-     FILE *stream;
-     const char *name;
-{
-  default_globalize_label (stream, name);
-  vms_check_external (NULL_TREE, name, 0);
-}
-#endif /* VMS_TARGET */
-
-/* Additional support code for VMS host.  */
-/* ??? This should really be in libiberty; vax.c is a target file.  */
-#ifdef QSORT_WORKAROUND
-  /*
-	Do not use VAXCRTL's qsort() due to a severe bug:  once you've
-	sorted something which has a size that's an exact multiple of 4
-	and is longword aligned, you cannot safely sort anything which
-	is either not a multiple of 4 in size or not longword aligned.
-	A static "move-by-longword" optimization flag inside qsort() is
-	never reset.  This is known to affect VMS V4.6 through VMS V5.5-1,
-	and was finally fixed in VMS V5.5-2.
-
-	In this work-around an insertion sort is used for simplicity.
-	The qsort code from glibc should probably be used instead.
-   */
-void
-not_qsort (array, count, size, compare)
-     void *array;
-     unsigned count, size;
-     int (*compare)();
-{
-
-  if (size == sizeof (short))
-    {
-      register int i;
-      register short *next, *prev;
-      short tmp, *base = array;
-
-      for (next = base, i = count - 1; i > 0; i--)
-	{
-	  prev = next++;
-	  if ((*compare)(next, prev) < 0)
-	    {
-	      tmp = *next;
-	      do  *(prev + 1) = *prev;
-		while (--prev >= base ? (*compare)(&tmp, prev) < 0 : 0);
-	      *(prev + 1) = tmp;
-	    }
-	}
-    }
-  else if (size == sizeof (long))
-    {
-      register int i;
-      register long *next, *prev;
-      long tmp, *base = array;
-
-      for (next = base, i = count - 1; i > 0; i--)
-	{
-	  prev = next++;
-	  if ((*compare)(next, prev) < 0)
-	    {
-	      tmp = *next;
-	      do  *(prev + 1) = *prev;
-		while (--prev >= base ? (*compare)(&tmp, prev) < 0 : 0);
-	      *(prev + 1) = tmp;
-	    }
-	}
-    }
-  else  /* arbitrary size */
-    {
-      register int i;
-      register char *next, *prev, *tmp = alloca (size), *base = array;
-
-      for (next = base, i = count - 1; i > 0; i--)
-	{   /* count-1 forward iterations */
-	  prev = next,  next += size;		/* increment front pointer */
-	  if ((*compare)(next, prev) < 0)
-	    {	/* found element out of order; move others up then re-insert */
-	      memcpy (tmp, next, size);		/* save smaller element */
-	      do { memcpy (prev + size, prev, size); /* move larger elem. up */
-		   prev -= size;		/* decrement back pointer */
-		 } while (prev >= base ? (*compare)(tmp, prev) < 0 : 0);
-	      memcpy (prev + size, tmp, size);	/* restore small element */
-	    }
-	}
-#ifdef USE_C_ALLOCA
-      alloca (0);
-#endif
-    }
-
-  return;
-}
-#endif /* QSORT_WORKAROUND */
-
 /* Return 1 if insn A follows B.  */
 
 static int


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