OSDN Git Service

* sh.h (current_function_anonymous_args): Remove.
authoramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 21 Feb 2002 16:42:28 +0000 (16:42 +0000)
committeramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 21 Feb 2002 16:42:28 +0000 (16:42 +0000)
(SETUP_INCOMING_VARARGS): Don't set it - just check that one
of current_function_varargs and current_function_stdarg is set.
* sh.c (sh_expand_prologue): Check current_function_varargs /
current_function_stdarg / TARGET_SH5 instead of
current_function_anonymous_args.

* sh64.h (TARGET_VERSION): Define.

Fix comments that to refer to SH architecture -
the architecture is no longer exclusive to Hitachi.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49931 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/sh/elf.h
gcc/config/sh/lib1funcs.asm
gcc/config/sh/sh-protos.h
gcc/config/sh/sh.c
gcc/config/sh/sh.h
gcc/config/sh/sh.md
gcc/config/sh/sh64.h

index 23e9245..14bd7a7 100644 (file)
@@ -1,3 +1,14 @@
+Thu Feb 21 15:35:46 2002  J"orn Rennecke <joern.rennecke@superh.com>
+
+       * sh.h (current_function_anonymous_args): Remove.
+       (SETUP_INCOMING_VARARGS): Don't set it - just check that one
+       of current_function_varargs and current_function_stdarg is set.
+       * sh.c (sh_expand_prologue): Check current_function_varargs /
+       current_function_stdarg / TARGET_SH5 instead of
+       current_function_anonymous_args.
+
+       * sh64.h (TARGET_VERSION): Define.
+
 2002-02-20  David Edelsohn  <edelsohn@gnu.org>
 
        * config/rs6000/rs6000.h (EPILOGUE_USES): Conditionalize
index 9bd5a36..d5aa947 100644 (file)
@@ -1,4 +1,4 @@
-/* Definitions of target machine for gcc for Hitachi Super-H using ELF.
+/* Definitions of target machine for gcc for Hitachi / SuperH SH using ELF.
    Copyright (C) 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
    Contributed by Ian Lance Taylor <ian@cygnus.com>.
 
index 53ca874..1f61a8d 100644 (file)
@@ -25,7 +25,7 @@ along with this program; see the file COPYING.  If not, write to
 the Free Software Foundation, 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
-!! libgcc routines for the Hitachi SH cpu.
+!! libgcc routines for the Hitachi / SuperH SH CPUs.
 !! Contributed by Steve Chamberlain.
 !! sac@cygnus.com
 
index 59ed9e7..d7a1162 100644 (file)
@@ -1,4 +1,4 @@
-/* Definitions of target machine for GNU compiler for Hitachi Super-H.
+/* Definitions of target machine for GNU compiler for Hitachi / SuperH SH
    Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
    Free Software Foundation, Inc.
    Contributed by Steve Chamberlain (sac@cygnus.com).
index 9a28853..10f342c 100644 (file)
@@ -1,4 +1,4 @@
-/* Output routines for GCC for Hitachi Super-H.
+/* Output routines for GCC for Hitachi / SuperH SH.
    Copyright (C) 1993, 1994, 1995, 1997, 1997, 1998, 1999, 2000, 2001, 2002
    Free Software Foundation, Inc.
    Contributed by Steve Chamberlain (sac@cygnus.com).
@@ -4503,14 +4503,11 @@ sh_expand_prologue ()
        }
     }
 
-  /* This is set by SETUP_VARARGS to indicate that this is a varargs
-     routine.  Clear it here so that the next function isn't affected.  */
-  if (current_function_anonymous_args)
+  /* Emit the code for SETUP_VARARGS.  */
+  if (current_function_varargs || current_function_stdarg)
     {
-      current_function_anonymous_args = 0;
-
       /* This is not used by the SH3E calling convention  */
-      if (TARGET_SH1 && ! TARGET_SH3E && ! TARGET_HITACHI)
+      if (TARGET_SH1 && ! TARGET_SH3E && ! TARGET_SH5 && ! TARGET_HITACHI)
        {
          /* Push arg regs as if they'd been provided by caller in stack.  */
          for (i = 0; i < NPARM_REGS(SImode); i++)
index 880ab41..1a48621 100644 (file)
@@ -1,4 +1,4 @@
-/* Definitions of target machine for GNU compiler for Hitachi Super-H.
+/* Definitions of target machine for GNU compiler for Hitachi / SuperH SH.
    Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
    Free Software Foundation, Inc.
    Contributed by Steve Chamberlain (sac@cygnus.com).
@@ -1938,13 +1938,18 @@ struct sh_args {
    && ((CUM).arg_count[(int) SH_ARG_INT]                       \
        + (int_size_in_bytes (TYPE) + 7) / 8) > NPARM_REGS (SImode))
 
-extern int current_function_anonymous_args;
-
 /* Perform any needed actions needed for a function that is receiving a
    variable number of arguments.  */
 
-#define SETUP_INCOMING_VARARGS(ASF, MODE, TYPE, PAS, ST) \
-  current_function_anonymous_args = ! TARGET_SH5
+/* We actually emit the code in sh_expand_prologue.  We used to use
+   a static variable to flag that we need to emit this code, but that
+   doesn't when inlining, when functions are deferred and then emitted
+   later.  Fortunately, we already have two flags that are part of struct
+   function that tell if a function uses varargs or stdarg.  */
+#define SETUP_INCOMING_VARARGS(ASF, MODE, TYPE, PAS, ST)  do \
+  if (! current_function_varargs && ! current_function_stdarg) \
+    abort (); \
+while (0)
 
 /* Define the `__builtin_va_list' type for the ABI.  */
 #define BUILD_VA_LIST_TYPE(VALIST) \
index 01c7aba..263d9bd 100644 (file)
@@ -1,4 +1,4 @@
-;;- Machine description for the Hitachi SH.
+;;- Machine description for Hitachi / SuperH SH.
 ;;  Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
 ;;  Free Software Foundation, Inc.
 ;;  Contributed by Steve Chamberlain (sac@cygnus.com).
index ccf7f48..c23c354 100644 (file)
@@ -1,4 +1,4 @@
-/* Definitions of target machine for GNU compiler for Hitachi Super-H 5.
+/* Definitions of target machine for GNU compiler for SuperH SH 5.
    Copyright 2000, 2001 Free Software Foundation, Inc.
    Contributed by Alexandre Oliva <aoliva@redhat.com>
 
@@ -19,6 +19,10 @@ along with GNU CC; see the file COPYING.  If not, write to
 the Free Software Foundation, 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
+#undef TARGET_VERSION
+#define TARGET_VERSION \
+  fputs (" (SuperH SH)", stderr);
+
 #undef CPP_DEFAULT_CPU_SPEC
 #define CPP_DEFAULT_CPU_SPEC "-D__SH5__=32 -D__SHMEDIA__"