diff mbox

Cleanup i386/sysv4.h

Message ID yddfws6qv3v.fsf@manam.CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth Feb. 2, 2011, 4:06 p.m. UTC
Prompted by the discussion in this thread

	http://gcc.gnu.org/ml/gcc-patches/2011-02/msg00018.html

it turned out that the definition of ASM_OUTPUT_ASCII is O(n^4) and
unnecessary since the elfos.h default works.

Since i386/sysv4.h is only used by Solaris 2/x86, I'll install the
following patch once Solaris 9/x86 testing has completed:

* SUBTARGET_RETURN_IN_MEMORY is undefined again in i386/sol2.h, so
  there's no point in defining it at all.

* TARGET_VERSION is wrong for the only remaining user, and should go
  anyway.

* ASM_OUTPUT_ASCII prompted this cleanup.  While I cannot currently test
  Solaris 8/x86, I don't expect problems.

i386-pc-solaris2.10 and i386-pc-solaris2.11 bootstraps with both Sun as
and gas completed without regressions and the testcase

$ cc1 gcc.c-torture/compile/pr46534.c -O3 -o /dev/null

was sped up by a factor of 20 to 36 depending on CPU.

	Rainer


2011-02-02  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* config/i386/sysv4.h (TARGET_VERSION): Remove.
	(SUBTARGET_RETURN_IN_MEMORY): Remove.
	(ASM_OUTPUT_ASCII): Remove.
	* config/i386/sol2.h (SUBTARGET_RETURN_IN_MEMORY): Remove #undef.
diff mbox

Patch

diff -r 1d2a5939dcf3 gcc/config/i386/sol2.h
--- a/gcc/config/i386/sol2.h	Fri Jan 28 16:26:21 2011 +0100
+++ b/gcc/config/i386/sol2.h	Wed Feb 02 14:35:41 2011 +0100
@@ -1,6 +1,6 @@ 
 /* Target definitions for GCC for Intel 80386 running Solaris 2
    Copyright (C) 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-   2004, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+   2004, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
    Contributed by Fred Fish (fnf@cygnus.com).
 
 This file is part of GCC.
@@ -137,9 +137,6 @@ 
 /* Register the Solaris-specific #pragma directives.  */
 #define REGISTER_SUBTARGET_PRAGMAS() solaris_register_pragmas ()
 
-/* Undo i386/sysv4.h version.  */
-#undef SUBTARGET_RETURN_IN_MEMORY
-
 /* Augment i386/unix.h version to return 8-byte vectors in memory, matching
    Sun Studio compilers until version 12, the only ones supported on
    Solaris 8 and 9.  */
diff -r 1d2a5939dcf3 gcc/config/i386/sysv4.h
--- a/gcc/config/i386/sysv4.h	Fri Jan 28 16:26:21 2011 +0100
+++ b/gcc/config/i386/sysv4.h	Wed Feb 02 14:35:41 2011 +0100
@@ -1,5 +1,6 @@ 
 /* Target definitions for GCC for Intel 80386 running System V.4
-   Copyright (C) 1991, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
+   Copyright (C) 1991, 2001, 2002, 2007, 2008, 2011
+   Free Software Foundation, Inc.
 
    Written by Ron Guilmette (rfg@netcom.com).
 
@@ -19,16 +20,6 @@ 
 along with GCC; see the file COPYING3.  If not see
 <http://www.gnu.org/licenses/>.  */
 
-
-#define TARGET_VERSION fprintf (stderr, " (i386 System V Release 4)");
-
-/* The svr4 ABI for the i386 says that records and unions are returned
-   in memory.  */
-
-#define SUBTARGET_RETURN_IN_MEMORY(TYPE, FNTYPE) \
-	(TYPE_MODE (TYPE) == BLKmode \
-	 || (VECTOR_MODE_P (TYPE_MODE (TYPE)) && int_size_in_bytes (TYPE) == 8));
-
 /* Output at beginning of assembler file.  */
 /* The .file command should always begin the output.  */
 
@@ -39,56 +30,6 @@ 
 #undef DBX_REGISTER_NUMBER
 #define DBX_REGISTER_NUMBER(n)  svr4_dbx_register_map[n]
 
-/* The routine used to output sequences of byte values.  We use a special
-   version of this for most svr4 targets because doing so makes the
-   generated assembly code more compact (and thus faster to assemble)
-   as well as more readable.  Note that if we find subparts of the
-   character sequence which end with NUL (and which are shorter than
-   STRING_LIMIT) we output those using ASM_OUTPUT_LIMITED_STRING.  */
-
-#undef ASM_OUTPUT_ASCII
-#define ASM_OUTPUT_ASCII(FILE, STR, LENGTH)				\
-  do									\
-    {									\
-      const unsigned char *_ascii_bytes =				\
-        (const unsigned char *) (STR);					\
-      const unsigned char *limit = _ascii_bytes + (LENGTH);		\
-      unsigned bytes_in_chunk = 0;					\
-      for (; _ascii_bytes < limit; _ascii_bytes++)			\
-	{								\
-	  const unsigned char *p;					\
-	  if (bytes_in_chunk >= 64)					\
-	    {								\
-	      fputc ('\n', (FILE));					\
-	      bytes_in_chunk = 0;					\
-	    }								\
-	  for (p = _ascii_bytes; p < limit && *p != '\0'; p++)		\
-	    continue;							\
-	  if (p < limit && (p - _ascii_bytes) <= (long) STRING_LIMIT)	\
-	    {								\
-	      if (bytes_in_chunk > 0)					\
-		{							\
-		  fputc ('\n', (FILE));					\
-		  bytes_in_chunk = 0;					\
-		}							\
-	      ASM_OUTPUT_LIMITED_STRING ((FILE), _ascii_bytes);		\
-	      _ascii_bytes = p;						\
-	    }								\
-	  else								\
-	    {								\
-	      if (bytes_in_chunk == 0)					\
-		fputs (ASM_BYTE, (FILE));				\
-	      else							\
-		fputc (',', (FILE));					\
-	      fprintf ((FILE), "0x%02x", *_ascii_bytes);		\
-	      bytes_in_chunk += 5;					\
-	    }								\
-	}								\
-      if (bytes_in_chunk > 0)						\
-	fputc ('\n', (FILE));						\
-    }									\
-  while (0)
-
 /* A C statement (sans semicolon) to output to the stdio stream
    FILE the assembler definition of uninitialized global DECL named
    NAME whose size is SIZE bytes and alignment is ALIGN bytes.