]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c-decl.c, [...]: Don't check TARGET_MEM_FUNCTIONS.
authorJoseph Myers <jsm@polyomino.org.uk>
Mon, 5 Jul 2004 19:49:20 +0000 (20:49 +0100)
committerJoseph Myers <jsm28@gcc.gnu.org>
Mon, 5 Jul 2004 19:49:20 +0000 (20:49 +0100)
* c-decl.c, config/m32r/m32r.c, expr.c, optabs.c: Don't check
TARGET_MEM_FUNCTIONS.
* system.h: Poison TARGET_MEM_FUNCTIONS.
* libfuncs.h (LTI_bcopy, LTI_bcmp, LTI_bzero, bcopy_libfunc,
bcmp_libfunc, bzero_libfunc): Remove.
* optabs.c (init_obtabs): Don't set bcopy_libfunc, bcmp_libfunc or
bzero_libfunc.
* doc/tm.texi (TARGET_MEM_FUNCTIONS): Remove.
* doc/standards.texi: Don't mention calling BSD string functions.
* doc/invoke.texi: Likewise.  Mention that memmove may be called.
* config/vax/t-memfuncs: New.
* config/memcmp.c, config/memcpy.c, config/memmove.c,
config/memset.c: New.
* config/pdp11/t-pdp11 (LIB2FUNCS_EXTRA): Use these files.
* config.gcc (vax-*-bsd*, vax-*-sysv*, vax-*-ultrix*): Use
vax/t-memfuncs.
* config/alpha/alpha.h, config/arc/arc.h, config/arm/arm.h,
config/avr/avr.h, config/c4x/c4x.h, config/cris/aout.h,
config/elfos.h, config/gnu.h, config/h8300/h8300.h,
config/i386/gas.h, config/ia64/ia64.h, config/interix.h,
config/ip2k/ip2k.h, config/lynx-ng.h, config/m32r/m32r.h,
config/mcore/mcore.h, config/mips/mips.h, config/mmix/mmix.h,
config/netbsd.h, config/openbsd.h, config/pa/pa.h,
config/rs6000/rs6000.h, config/rtems.h, config/s390/s390.h,
config/sh/sh.h, config/sparc/sparc.h, config/stormy16/stormy16.h,
config/svr3.h: Don't define TARGET_MEM_FUNCTIONS.

From-SVN: r84130

45 files changed:
gcc/ChangeLog
gcc/c-decl.c
gcc/config.gcc
gcc/config/alpha/alpha.h
gcc/config/arc/arc.h
gcc/config/arm/arm.h
gcc/config/avr/avr.h
gcc/config/c4x/c4x.h
gcc/config/cris/aout.h
gcc/config/elfos.h
gcc/config/gnu.h
gcc/config/h8300/h8300.h
gcc/config/i386/gas.h
gcc/config/ia64/ia64.h
gcc/config/interix.h
gcc/config/ip2k/ip2k.h
gcc/config/lynx-ng.h
gcc/config/m32r/m32r.c
gcc/config/m32r/m32r.h
gcc/config/mcore/mcore.h
gcc/config/memcmp.c [new file with mode: 0644]
gcc/config/memcpy.c [new file with mode: 0644]
gcc/config/memmove.c [new file with mode: 0644]
gcc/config/memset.c [new file with mode: 0644]
gcc/config/mips/mips.h
gcc/config/mmix/mmix.h
gcc/config/netbsd.h
gcc/config/openbsd.h
gcc/config/pa/pa.h
gcc/config/pdp11/t-pdp11
gcc/config/rs6000/rs6000.h
gcc/config/rtems.h
gcc/config/s390/s390.h
gcc/config/sh/sh.h
gcc/config/sparc/sparc.h
gcc/config/stormy16/stormy16.h
gcc/config/svr3.h
gcc/config/vax/t-memfuncs [new file with mode: 0644]
gcc/doc/invoke.texi
gcc/doc/standards.texi
gcc/doc/tm.texi
gcc/expr.c
gcc/libfuncs.h
gcc/optabs.c
gcc/system.h

index cce5964af42b5ae73ddb71a0aa77d6eb687f02fc..66f6821dfc17cd552ed27eee4338f570b0be54e7 100644 (file)
@@ -1,3 +1,32 @@
+2004-07-05  Joseph S. Myers  <jsm@polyomino.org.uk>
+
+       * c-decl.c, config/m32r/m32r.c, expr.c, optabs.c: Don't check
+       TARGET_MEM_FUNCTIONS.
+       * system.h: Poison TARGET_MEM_FUNCTIONS.
+       * libfuncs.h (LTI_bcopy, LTI_bcmp, LTI_bzero, bcopy_libfunc,
+       bcmp_libfunc, bzero_libfunc): Remove.
+       * optabs.c (init_obtabs): Don't set bcopy_libfunc, bcmp_libfunc or
+       bzero_libfunc.
+       * doc/tm.texi (TARGET_MEM_FUNCTIONS): Remove.
+       * doc/standards.texi: Don't mention calling BSD string functions.
+       * doc/invoke.texi: Likewise.  Mention that memmove may be called.
+       * config/vax/t-memfuncs: New.
+       * config/memcmp.c, config/memcpy.c, config/memmove.c,
+       config/memset.c: New.
+       * config/pdp11/t-pdp11 (LIB2FUNCS_EXTRA): Use these files.
+       * config.gcc (vax-*-bsd*, vax-*-sysv*, vax-*-ultrix*): Use
+       vax/t-memfuncs.
+       * config/alpha/alpha.h, config/arc/arc.h, config/arm/arm.h,
+       config/avr/avr.h, config/c4x/c4x.h, config/cris/aout.h,
+       config/elfos.h, config/gnu.h, config/h8300/h8300.h,
+       config/i386/gas.h, config/ia64/ia64.h, config/interix.h,
+       config/ip2k/ip2k.h, config/lynx-ng.h, config/m32r/m32r.h,
+       config/mcore/mcore.h, config/mips/mips.h, config/mmix/mmix.h,
+       config/netbsd.h, config/openbsd.h, config/pa/pa.h,
+       config/rs6000/rs6000.h, config/rtems.h, config/s390/s390.h,
+       config/sh/sh.h, config/sparc/sparc.h, config/stormy16/stormy16.h,
+       config/svr3.h: Don't define TARGET_MEM_FUNCTIONS.
+
 2004-07-05  Richard Henderson  <rth@redhat.com>
 
        * function.c (assign_parm_setup_reg): Properly rename variables in
index 56351512ff48cea6abad991388694247706ba86d..5e34bb59e82cda9425a1be64e8e9856fb388b808 100644 (file)
@@ -2944,17 +2944,10 @@ finish_decl (tree decl, tree init, tree asmspec_tree)
          tree builtin = built_in_decls [DECL_FUNCTION_CODE (decl)];
          SET_DECL_RTL (builtin, NULL_RTX);
          change_decl_assembler_name (builtin, get_identifier (starred));
-#ifdef TARGET_MEM_FUNCTIONS
          if (DECL_FUNCTION_CODE (decl) == BUILT_IN_MEMCPY)
            init_block_move_fn (starred);
          else if (DECL_FUNCTION_CODE (decl) == BUILT_IN_MEMSET)
            init_block_clear_fn (starred);
-#else
-         if (DECL_FUNCTION_CODE (decl) == BUILT_IN_BCOPY)
-           init_block_move_fn (starred);
-         else if (DECL_FUNCTION_CODE (decl) == BUILT_IN_BZERO)
-           init_block_clear_fn (starred);
-#endif
        }
       SET_DECL_RTL (decl, NULL_RTX);
       change_decl_assembler_name (decl, get_identifier (starred));
index 35b55d5487a66fae5dc23d7b27216f3418560ae2..2d70d44708cb6fb2201d320329342fed38c7c7d5 100644 (file)
@@ -2012,11 +2012,13 @@ v850-*-*)
        ;;
 vax-*-bsd*)                    # VAXen running BSD
        tm_file="${tm_file} vax/bsd.h"
+       tmake_file=vax/t-memfuncs
        use_collect2=yes
        use_fixproto=yes
        ;;
 vax-*-sysv*)                   # VAXen running system V
        tm_file="${tm_file} vax/vaxv.h"
+       tmake_file=vax/t-memfuncs
        use_fixproto=yes
        ;;
 vax-*-netbsdelf*)
@@ -2034,6 +2036,7 @@ vax-*-openbsd*)
        ;;
 vax-*-ultrix*)                 # VAXen running ultrix
        tm_file="${tm_file} vax/ultrix.h"
+       tmake_file=vax/t-memfuncs
        use_fixproto=yes
        ;;
 xscale-*-elf)
index 8cc22caf1b4ce1cb1f7eb973c53471e8e386fe86..8e03fd7531039c05ab0ae96159f1f17813f4db72 100644 (file)
@@ -1835,6 +1835,3 @@ do {                                                      \
 
 /* The system headers under Alpha systems are generally C++-aware.  */
 #define NO_IMPLICIT_EXTERN_C
-
-/* Generate calls to memcpy, etc., not bcopy, etc.  */
-#define TARGET_MEM_FUNCTIONS 1
index f25e5d369d3ec96cb76f0ddea5bd067467c60f77..1ee15192711611fa1df7cb688aa34e072601726a 100644 (file)
@@ -802,11 +802,6 @@ do { \
   emit_insn (gen_flush_icache (validize_mem (gen_rtx_MEM (SImode, TRAMP)))); \
 } while (0)
 \f
-/* Library calls.  */
-
-/* Generate calls to memcpy, memcmp and memset.  */
-#define TARGET_MEM_FUNCTIONS
-\f
 /* Addressing modes, and classification of registers for them.  */
 
 /* Maximum number of registers that can appear in a valid memory address.  */
index 4b4ddedf483fb54aa5d5747fd8b8ad622291b006..3067153131f29e20deee1c7737368becb3f898d5 100644 (file)
@@ -536,9 +536,6 @@ extern int arm_is_6_or_7;
    that is controlled by the APCS-FRAME option.  */
 #define CAN_DEBUG_WITHOUT_FP
 
-#undef  TARGET_MEM_FUNCTIONS
-#define TARGET_MEM_FUNCTIONS 1
-
 #define OVERRIDE_OPTIONS  arm_override_options ()
 
 /* Nonzero if PIC code requires explicit qualifiers to generate
index c9beb30410f220dbac87b45ecff80daa4bb0dd24..da06c207604dc3a4a883771da207d2aff280de1f 100644 (file)
@@ -803,8 +803,6 @@ extern int avr_case_values_threshold;
 #define ADJUST_INSN_LENGTH(INSN, LENGTH) (LENGTH =\
                                          adjust_insn_length (INSN, LENGTH))
 
-#define TARGET_MEM_FUNCTIONS
-
 #define CPP_SPEC "%{posix:-D_POSIX_SOURCE}"
 
 #define CC1_SPEC "%{profile:-p}"
index 3079c0a66c6c4ff0f2cba0368a636c1fa5664c6f..cff2548df775c3f9519f35d31ec7a605bef78556 100644 (file)
@@ -1193,10 +1193,6 @@ CUMULATIVE_ARGS;
        fprintf (FILE, "\tpop\tar2\n");                         \
      }
 
-/* Implicit Calls to Library Routines.  */
-
-#define TARGET_MEM_FUNCTIONS
-
 /* CC_NOOVmode should be used when the first operand is a PLUS, MINUS, NEG
    or MULT.
    CCmode should be used when no special processing is needed.  */
index e77c73ce4324c8f1cc842d451039dabb89678cc1..9a409cf8a4283716cb4ca28f5f69a5f43e234052 100644 (file)
@@ -139,11 +139,6 @@ Boston, MA 02111-1307, USA.  */
 #define MAX_OFILE_ALIGNMENT 16
 
 
-/* Node: Library Calls */
-
-#define TARGET_MEM_FUNCTIONS
-
-
 /* Node: Data Output */
 
 #define ESCAPES \
index 6a138f9f76f816a0b8721d73308995457c169251..743ae71ab6dc0639cc09cbcb02c261f15d2614b6 100644 (file)
@@ -58,10 +58,6 @@ Boston, MA 02111-1307, USA.  */
 #define PCC_BITFIELD_TYPE_MATTERS 1
 #endif
 
-/* Implicit library calls should use memcpy, not bcopy, etc.  */
-
-#define TARGET_MEM_FUNCTIONS
-
 /* Handle #pragma weak and #pragma pack.  */
 
 #define HANDLE_SYSV_PRAGMA 1
index 23a8a730ec9862e1b3fe671af798bbc33d2c604d..79c64c77ba98871fd463a069e0e0101eb5377fa5 100644 (file)
 #undef STANDARD_INCLUDE_DIR
 #define STANDARD_INCLUDE_DIR "/include"
 
-/* Implicit library calls should use memcpy, not bcopy, etc.  */
-#undef TARGET_MEM_FUNCTIONS
-#define TARGET_MEM_FUNCTIONS
-
 /* The system headers under GNU are C++-aware.  */
 #define NO_IMPLICIT_EXTERN_C
 
index eeafd84a24e50e84925f71c5ad5c0f494e8433c9..fcb082372a125a86dc6f8964e4208e23e90e8964 100644 (file)
@@ -1138,12 +1138,6 @@ struct cum_arg
 #define FINAL_PRESCAN_INSN(insn, operand, nop) \
   final_prescan_insn (insn, operand, nop)
 
-/* Define this macro if GCC should generate calls to the System V
-   (and ANSI C) library functions `memcpy' and `memset' rather than
-   the BSD functions `bcopy' and `bzero'.  */
-
-#define TARGET_MEM_FUNCTIONS
-
 #define MOVE_RATIO 3
 
 /* Define the codes that are matched by predicates in h8300.c.  */
index 78195b97a854929662bde64cf17a76c3b5001d14..9f002431018527fc98bbaa585f37101fe73c48ea 100644 (file)
@@ -49,10 +49,6 @@ Boston, MA 02111-1307, USA.  */
 
 #define ASM_OUTPUT_IDENT(FILE, NAME) fprintf (FILE, "\t.ident \"%s\"\n", NAME);
 
-/* Implicit library calls should use memcpy, not bcopy, etc.  */
-
-#define TARGET_MEM_FUNCTIONS
-
 /* In the past there was confusion as to what the argument to .align was
    in GAS.  For the last several years the rule has been this: for a.out
    file formats that argument is LOG, and for all other file formats the
index a26a1da4b870965704932dfb5aa4037e34f80b48..930266c6f85a5d1f24b75345d944b82ee4969d30 100644 (file)
@@ -1555,15 +1555,6 @@ do {                                                                     \
 
 #define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, STATIC_CHAIN) \
   ia64_initialize_trampoline((ADDR), (FNADDR), (STATIC_CHAIN))
-\f
-/* Implicit Calls to Library Routines */
-
-/* Define this macro if GCC should generate calls to the System V (and ANSI
-   C) library functions `memcpy' and `memset' rather than the BSD functions
-   `bcopy' and `bzero'.  */
-
-#define TARGET_MEM_FUNCTIONS
-
 \f
 /* Addressing Modes */
 
index 9d05f1bcc0adca50b782a204863a021ff8801f4a..9db2d84af98fab867b7220349598b2f777cdbd8b 100644 (file)
@@ -22,10 +22,6 @@ along with GCC; see the file COPYING.  If not, write to
 the Free Software Foundation, 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
-#ifndef TARGET_MEM_FUNCTIONS
-#define TARGET_MEM_FUNCTIONS
-#endif
-
 /* POSIX/Uni-thread only for now.  Look at the winnt version
 for windows/multi thread */
 
index d78ae7779b1b44d9bb36ad75e7c489949f56970b..c24c49370f5644f5798a47a5ed9fec387718901c 100644 (file)
@@ -808,8 +808,6 @@ extern int ip2k_reorg_merge_qimode;
 #define FUNCTION_PROFILER(FILE, LABELNO)  \
   fprintf ((FILE), "/* profiler %d */", (LABELNO))
 
-#define TARGET_MEM_FUNCTIONS
-
 #undef ENDFILE_SPEC
 #undef LINK_SPEC
 #undef STARTFILE_SPEC
index c23ad39a77f8f0eeaa6850e530d4971ecfa5bd05..a1fe786b463f57d0c3a76bc131f3a4cf1f7563e5 100644 (file)
@@ -64,10 +64,6 @@ Boston, MA 02111-1307, USA.  */
 
 #define SDB_DEBUGGING_INFO 1
 
-/* Generate calls to memcpy, memcmp and memset.  */
-
-#define TARGET_MEM_FUNCTIONS
-
 /* Handle #pragma pack and sometimes #pragma weak.  */
 
 #define HANDLE_SYSV_PRAGMA 1
index 5adc498c52f024e41470f422f9172acbe2aaa3d8..9de4eb34d286ed30a1bd4c0e8eedb555061cbc72 100644 (file)
@@ -2601,19 +2601,11 @@ block_move_call (rtx dest_reg, rtx src_reg, rtx bytes_rtx)
       && GET_MODE (bytes_rtx) != Pmode)
     bytes_rtx = convert_to_mode (Pmode, bytes_rtx, 1);
 
-#ifdef TARGET_MEM_FUNCTIONS
   emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "memcpy"), 0,
                     VOIDmode, 3, dest_reg, Pmode, src_reg, Pmode,
                     convert_to_mode (TYPE_MODE (sizetype), bytes_rtx,
                                      TYPE_UNSIGNED (sizetype)),
                     TYPE_MODE (sizetype));
-#else
-  emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "bcopy"), 0,
-                    VOIDmode, 3, src_reg, Pmode, dest_reg, Pmode,
-                    convert_to_mode (TYPE_MODE (integer_type_node), bytes_rtx,
-                                     TYPE_UNSIGNED (integer_type_node)),
-                    TYPE_MODE (integer_type_node));
-#endif
 }
 
 /* The maximum number of bytes to copy using pairs of load/store instructions.
index c20b0424bb0178999cda52ddaa48103997fabe8e..14f266c0949773f5e4cfbdb149a7d94d1852dfd3 100644 (file)
@@ -1260,11 +1260,6 @@ L2:     .word STATIC
     }                                                                          \
   while (0)
 \f
-/* Library calls.  */
-
-/* Generate calls to memcpy, memcmp and memset.  */
-#define TARGET_MEM_FUNCTIONS
-\f
 #define RETURN_ADDR_RTX(COUNT, FRAME) m32r_return_addr (COUNT)
 
 #define INCOMING_RETURN_ADDR_RTX   gen_rtx_REG (Pmode, RETURN_ADDR_REGNUM)
index ccae6d945dd4029a02290665c056225b9f5cdf50..b6e5d87a42a30c1999178748a6631855c35aa73b 100644 (file)
@@ -953,9 +953,6 @@ extern const enum reg_class reg_class_from_letter[];
 
 #define WORD_REGISTER_OPERATIONS
 
-/* Implicit library calls should use memcpy, not bcopy, etc.  */
-#define TARGET_MEM_FUNCTIONS
-
 /* Assembler output control.  */
 #define ASM_COMMENT_START "\t//"
 
diff --git a/gcc/config/memcmp.c b/gcc/config/memcmp.c
new file mode 100644 (file)
index 0000000..2348afe
--- /dev/null
@@ -0,0 +1,16 @@
+/* Public domain.  */
+#include <stddef.h>
+
+int
+memcmp (const void *str1, const void *str2, size_t count)
+{
+  const unsigned char *s1 = str1;
+  const unsigned char *s2 = str2;
+
+  while (count-- > 0)
+    {
+      if (*s1++ != *s2++)
+         return s1[-1] < s2[-1] ? -1 : 1;
+    }
+  return 0;
+}
diff --git a/gcc/config/memcpy.c b/gcc/config/memcpy.c
new file mode 100644 (file)
index 0000000..58b1e40
--- /dev/null
@@ -0,0 +1,12 @@
+/* Public domain.  */
+#include <stddef.h>
+
+void *
+memcpy (void *dest, const void *src, size_t len)
+{
+  char *d = dest;
+  const char *s = src;
+  while (len--)
+    *d++ = *s++;
+  return dest;
+}
diff --git a/gcc/config/memmove.c b/gcc/config/memmove.c
new file mode 100644 (file)
index 0000000..13b340a
--- /dev/null
@@ -0,0 +1,20 @@
+/* Public domain.  */
+#include <stddef.h>
+
+void *
+memmove (void *dest, const void *src, size_t len)
+{
+  char *d = dest;
+  const char *s = src;
+  if (d < s)
+    while (len--)
+      *d++ = *s++;
+  else
+    {
+      char *lasts = s + (len-1);
+      char *lastd = d + (len-1);
+      while (len--)
+        *lastd-- = *lasts--;
+    }
+  return dest;
+}
diff --git a/gcc/config/memset.c b/gcc/config/memset.c
new file mode 100644 (file)
index 0000000..3e7025e
--- /dev/null
@@ -0,0 +1,11 @@
+/* Public domain.  */
+#include <stddef.h>
+
+void *
+memset (void *dest, int val, size_t len)
+{
+  unsigned char *ptr = dest;
+  while (len-- > 0)
+    *ptr++ = val;
+  return dest;
+}
index 1722041c542fd8903cc59208a109f8aa096decd0..77ea0e0e32ebe9d13d471fb808281a264587352b 100644 (file)
@@ -3363,9 +3363,6 @@ while (0)
 
 #define DONT_ACCESS_GBLS_AFTER_EPILOGUE (TARGET_ABICALLS && !TARGET_OLDABI)
 \f
-/* Generate calls to memcpy, etc., not bcopy, etc.  */
-#define TARGET_MEM_FUNCTIONS
-
 #ifndef __mips16
 /* Since the bits of the _init and _fini function is spread across
    many object files, each potentially with its own GP, we must assume
index 01090b7771a9f10be5358ef6d652cde4e0cd8e8e..8e5432bb211f5f5f1ef152b52d9bfdf8f4f20510 100644 (file)
@@ -806,11 +806,6 @@ typedef struct { int regs; int lib; } CUMULATIVE_ARGS;
  mmix_initialize_trampoline (ADDR, FNADDR, STATIC_CHAIN)
 
 
-/* Node: Library Calls */
-
-#define TARGET_MEM_FUNCTIONS
-
-
 /* Node: Addressing Modes */
 
 #define CONSTANT_ADDRESS_P(X) \
index e3eb0d1ffa800480428f37ec3fdc8731f87fd8a3..40adf1a381d207cf66dd4955bcb733e6db7ff584 100644 (file)
@@ -159,11 +159,6 @@ Boston, MA 02111-1307, USA.  */
 #undef TARGET_HAS_F_SETLKW
 #define TARGET_HAS_F_SETLKW
 
-/* Implicit library calls should use memcpy, not bcopy, etc.  */
-
-#undef TARGET_MEM_FUNCTIONS
-#define TARGET_MEM_FUNCTIONS 1
-
 /* Handle #pragma weak and #pragma pack.  */
 
 #define HANDLE_SYSV_PRAGMA 1
index 670a0a08aa15ee73f39ec4f2f89bb06f5e403309..b472182718ff98623865d6ee64a0327dc36f4923 100644 (file)
@@ -130,13 +130,6 @@ Boston, MA 02111-1307, USA.  */
 \f
 /* Runtime target specification.  */
 
-/* Implicit calls to library routines.  */
-
-/* Use memcpy and memset instead of bcopy and bzero.  */
-#ifndef TARGET_MEM_FUNCTIONS
-#define TARGET_MEM_FUNCTIONS
-#endif
-
 /* Miscellaneous parameters.  */
 
 /* Controlling debugging info: dbx options.  */
index 1b6a2c8f2f0e2365f83ed7be64edff1340a6a44f..fec6f2cf0ca32e3454a6719aa4abf52ebee15593 100644 (file)
@@ -500,9 +500,6 @@ do {                                                                \
    when given unaligned data.  */
 #define STRICT_ALIGNMENT 1
 
-/* Generate calls to memcpy, memcmp and memset.  */
-#define TARGET_MEM_FUNCTIONS
-
 /* Value is 1 if it is a good idea to tie two pseudo registers
    when one has mode MODE1 and one has mode MODE2.
    If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
index 0231a7b38d6cb66c749a006b7c583b8bf7812304..c0a23c2ec45261e242144b4f89b4b34517490980 100644 (file)
@@ -1,5 +1,7 @@
 TARGET_LIBGCC2_CFLAGS = -O2 -mfloat32
-LIB2FUNCS_EXTRA = $(srcdir)/config/udivmod.c $(srcdir)/config/udivmodsi4.c
+LIB2FUNCS_EXTRA = $(srcdir)/config/udivmod.c $(srcdir)/config/udivmodsi4.c \
+    $(srcdir)/config/memcmp.c $(srcdir)/config/memcpy.c \
+    $(srcdir)/config/memmove.c $(srcdir)/config/memset.c
 # floating point emulation libraries
 
 FPBIT = fp-bit.c
index 00aad36832d129f21ebb43f010e09a6801d28c09..17df6c082eb5ca6719fd5bd85d512a4d0116a4e8 100644 (file)
@@ -2217,10 +2217,6 @@ extern int rs6000_compare_fp_p;
    the end of the line.  */
 #define ASM_COMMENT_START " #"
 
-/* Implicit library calls should use memcpy, not bcopy, etc.  */
-
-#define TARGET_MEM_FUNCTIONS
-
 /* Flag to say the TOC is initialized */
 extern int toc_initialized;
 
index 2656ff78b3aa0fff260d8f67fb6a8453e9582ac3..301154325fbb75304407028d4d572c0464e6b98d 100644 (file)
@@ -21,11 +21,6 @@ Boston, MA 02111-1307, USA.  */
 /* The system headers under RTEMS are C++-aware.  */
 #define NO_IMPLICIT_EXTERN_C
 
-/* Generate calls to memcpy, memcmp and memset.  */
-#ifndef TARGET_MEM_FUNCTIONS
-#define TARGET_MEM_FUNCTIONS
-#endif
-
 /*
  * Dummy start/end specification to let linker work as
  * needed by autoconf scripts using this compiler.
index 30202e4b5b357b1249cfcbed8f7247bc092de9e6..85168b4d99a7deeb373cf745a98df20cfe6ca056 100644 (file)
@@ -722,12 +722,6 @@ CUMULATIVE_ARGS;
    s390_trampoline_template (FILE)
 
 
-/* Library calls.  */
-
-/* We should use memcpy, not bcopy.  */
-#define TARGET_MEM_FUNCTIONS
-
-
 /* Addressing modes, and classification of registers for them.  */
 
 /* Recognize any constant value that is a valid address.  */
index 0d6d1c6570c6e94d4730c99b9ef194f3198005f5..c9f411ae72f1f026f42f8cd2224dd37eee30738b 100644 (file)
@@ -3232,10 +3232,6 @@ enum mdep_reorg_phase_e
 
 extern enum mdep_reorg_phase_e mdep_reorg_phase;
 
-/* Generate calls to memcpy, memcmp and memset.  */
-
-#define TARGET_MEM_FUNCTIONS
-
 /* Handle Renesas compiler's pragmas.  */
 #define REGISTER_TARGET_PRAGMAS() do {                                 \
   c_register_pragma (0, "interrupt", sh_pr_interrupt);                 \
index 595a0f5fa88b1a44d3f568ca7471b667f8bb567e..030d3ab7863e591eb2006af8356c869ceae22926 100644 (file)
@@ -2207,9 +2207,6 @@ do {                                                                    \
 /* Specify the machine mode used for addresses.  */
 #define Pmode (TARGET_ARCH64 ? DImode : SImode)
 
-/* Generate calls to memcpy, memcmp and memset.  */
-#define TARGET_MEM_FUNCTIONS
-
 /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
    return the mode to be used for the comparison.  For floating-point,
    CCFP[E]mode is used.  CC_NOOVmode should be used when the first operand
index 051914b31d2b49f5e0df8a396369940017ed8d1a..b2472bc841f152af47f1ae2cb8d77626cd49d8ac 100644 (file)
@@ -497,10 +497,6 @@ enum reg_class
   xstormy16_initialize_trampoline (ADDR, FNADDR, STATIC_CHAIN)
 
 \f
-/* Implicit Calls to Library Routines */
-
-#define TARGET_MEM_FUNCTIONS
-
 /* Define this macro to override the type used by the library routines to pick
    up arguments of type `float'.  (By default, they use a union of `float' and
    `int'.)
index 21595eac2732c3ac2d9a0303923a8168d1ff7b3d..b544abba91a73065bc5edc8b728bc85549f4a8b6 100644 (file)
@@ -70,10 +70,6 @@ Boston, MA 02111-1307, USA. */
 
 #define NO_DOLLAR_IN_LABEL
 
-/* Implicit library calls should use memcpy, not bcopy, etc.  */
-
-#define TARGET_MEM_FUNCTIONS
-
 /* System V Release 3 uses COFF debugging info.  */
 
 #define SDB_DEBUGGING_INFO 1
diff --git a/gcc/config/vax/t-memfuncs b/gcc/config/vax/t-memfuncs
new file mode 100644 (file)
index 0000000..6a8da61
--- /dev/null
@@ -0,0 +1,3 @@
+LIB2FUNCS_EXTRA = \
+    $(srcdir)/config/memcmp.c $(srcdir)/config/memcpy.c \
+    $(srcdir)/config/memmove.c $(srcdir)/config/memset.c
index 625a6789672e25d8dd7b69dcff4aa959f818a655..c764ee800f79a3d09b130ae7b70e658411ee92fb 100644 (file)
@@ -5437,9 +5437,9 @@ or @option{-nodefaultlibs} is used.
 Do not use the standard system libraries when linking.
 Only the libraries you specify will be passed to the linker.
 The standard startup files are used normally, unless @option{-nostartfiles}
-is used.  The compiler may generate calls to memcmp, memset, and memcpy
-for System V (and ISO C) environments or to bcopy and bzero for
-BSD environments.  These entries are usually resolved by entries in
+is used.  The compiler may generate calls to @code{memcmp},
+@code{memset}, @code{memcpy} and @code{memmove}.
+These entries are usually resolved by entries in
 libc.  These entry points should be supplied through some other
 mechanism when this option is specified.
 
@@ -5447,9 +5447,9 @@ mechanism when this option is specified.
 @opindex nostdlib
 Do not use the standard system startup files or libraries when linking.
 No startup files and only the libraries you specify will be passed to
-the linker.  The compiler may generate calls to memcmp, memset, and memcpy
-for System V (and ISO C) environments or to bcopy and bzero for
-BSD environments.  These entries are usually resolved by entries in
+the linker.  The compiler may generate calls to @code{memcmp}, @code{memset},
+@code{memcpy} and @code{memmove}.
+These entries are usually resolved by entries in
 libc.  These entry points should be supplied through some other
 mechanism when this option is specified.
 
index faa08e4a9f64f6570b69a4ab9a79cdd526bcac81..dcedc754f5971437ce661c47877441f48bce4acf 100644 (file)
@@ -145,9 +145,7 @@ GNU C library).  @xref{Standard Libraries,,Standard Libraries}.
 Most of the compiler support routines used by GCC are present in
 @file{libgcc}, but there are a few exceptions.  GCC requires the
 freestanding environment provide @code{memcpy}, @code{memmove},
-@code{memset} and @code{memcmp}.  Some older ports of GCC are
-configured to use the BSD @code{bcopy}, @code{bzero} and @code{bcmp}
-functions instead, but this is deprecated for new ports.
+@code{memset} and @code{memcmp}.
 Finally, if @code{__builtin_trap} is used, and the target does
 not implement the @code{trap} pattern, then GCC will emit a call
 to @code{abort}.
index 1b5de1b71cbdd5ee5771ffff49828e94437d15e1..5cbff1c53d1c789d5fedbd222aff7130bea695c7 100644 (file)
@@ -4811,17 +4811,6 @@ refers to the global ``variable'' @code{errno}.  (On certain systems,
 macro, a reasonable default is used.
 @end defmac
 
-@cindex @code{bcopy}, implicit usage
-@cindex @code{memcpy}, implicit usage
-@cindex @code{memmove}, implicit usage
-@cindex @code{bzero}, implicit usage
-@cindex @code{memset}, implicit usage
-@defmac TARGET_MEM_FUNCTIONS
-Define this macro if GCC should generate calls to the ISO C
-(and System V) library functions @code{memcpy}, @code{memmove} and
-@code{memset} rather than the BSD functions @code{bcopy} and @code{bzero}.
-@end defmac
-
 @cindex C99 math functions, implicit usage
 @defmac TARGET_C99_FUNCTIONS
 When this macro is nonzero, GCC will implicitly optimize @code{sin} calls into
index efca348f547dcfe7f644d8e8d31b6ab9d0924552..3c15a7bde7aae0371d7f5d96d595321eb9486a74 100644 (file)
@@ -77,14 +77,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #endif
 #endif
 
-/* Convert defined/undefined to boolean.  */
-#ifdef TARGET_MEM_FUNCTIONS
-#undef TARGET_MEM_FUNCTIONS
-#define TARGET_MEM_FUNCTIONS 1
-#else
-#define TARGET_MEM_FUNCTIONS 0
-#endif
-
 
 /* If this is nonzero, we do not bother generating VOLATILE
    around volatile memory references, and we are willing to
@@ -1511,7 +1503,7 @@ emit_block_move_via_movstr (rtx x, rtx y, rtx size, unsigned int align)
   return false;
 }
 
-/* A subroutine of emit_block_move.  Expand a call to memcpy or bcopy.
+/* A subroutine of emit_block_move.  Expand a call to memcpy.
    Return the return value from memcpy, 0 otherwise.  */
 
 static rtx
@@ -1550,10 +1542,7 @@ emit_block_move_via_libcall (rtx dst, rtx src, rtx size)
   dst_tree = make_tree (ptr_type_node, dst_addr);
   src_tree = make_tree (ptr_type_node, src_addr);
 
-  if (TARGET_MEM_FUNCTIONS)
-    size_mode = TYPE_MODE (sizetype);
-  else
-    size_mode = TYPE_MODE (unsigned_type_node);
+  size_mode = TYPE_MODE (sizetype);
 
   size = convert_to_mode (size_mode, size, 1);
   size = copy_to_mode_reg (size_mode, size);
@@ -1562,27 +1551,14 @@ emit_block_move_via_libcall (rtx dst, rtx src, rtx size)
      memcpy in this context.  This could be a user call to memcpy and
      the user may wish to examine the return value from memcpy.  For
      targets where libcalls and normal calls have different conventions
-     for returning pointers, we could end up generating incorrect code.
+     for returning pointers, we could end up generating incorrect code.  */
 
-     For convenience, we generate the call to bcopy this way as well.  */
-
-  if (TARGET_MEM_FUNCTIONS)
-    size_tree = make_tree (sizetype, size);
-  else
-    size_tree = make_tree (unsigned_type_node, size);
+  size_tree = make_tree (sizetype, size);
 
   fn = emit_block_move_libcall_fn (true);
   arg_list = tree_cons (NULL_TREE, size_tree, NULL_TREE);
-  if (TARGET_MEM_FUNCTIONS)
-    {
-      arg_list = tree_cons (NULL_TREE, src_tree, arg_list);
-      arg_list = tree_cons (NULL_TREE, dst_tree, arg_list);
-    }
-  else
-    {
-      arg_list = tree_cons (NULL_TREE, dst_tree, arg_list);
-      arg_list = tree_cons (NULL_TREE, src_tree, arg_list);
-    }
+  arg_list = tree_cons (NULL_TREE, src_tree, arg_list);
+  arg_list = tree_cons (NULL_TREE, dst_tree, arg_list);
 
   /* Now we have to build up the CALL_EXPR itself.  */
   call_expr = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (fn)), fn);
@@ -1601,7 +1577,7 @@ emit_block_move_via_libcall (rtx dst, rtx src, rtx size)
                                             gen_rtx_CLOBBER (VOIDmode, dst),
                                             NULL_RTX));
 
-  return TARGET_MEM_FUNCTIONS ? retval : NULL_RTX;
+  return retval;
 }
 
 /* A subroutine of emit_block_move_via_libcall.  Create the tree node
@@ -1617,20 +1593,10 @@ init_block_move_fn (const char *asmspec)
     {
       tree args, fn;
 
-      if (TARGET_MEM_FUNCTIONS)
-       {
-         fn = get_identifier ("memcpy");
-         args = build_function_type_list (ptr_type_node, ptr_type_node,
-                                          const_ptr_type_node, sizetype,
-                                          NULL_TREE);
-       }
-      else
-       {
-         fn = get_identifier ("bcopy");
-         args = build_function_type_list (void_type_node, const_ptr_type_node,
-                                          ptr_type_node, unsigned_type_node,
-                                          NULL_TREE);
-       }
+      fn = get_identifier ("memcpy");
+      args = build_function_type_list (ptr_type_node, ptr_type_node,
+                                      const_ptr_type_node, sizetype,
+                                      NULL_TREE);
 
       fn = build_decl (FUNCTION_DECL, fn, args);
       DECL_EXTERNAL (fn) = 1;
@@ -2642,7 +2608,7 @@ clear_storage_via_clrstr (rtx object, rtx size, unsigned int align)
   return false;
 }
 
-/* A subroutine of clear_storage.  Expand a call to memset or bzero.
+/* A subroutine of clear_storage.  Expand a call to memset.
    Return the return value of memset, 0 otherwise.  */
 
 static rtx
@@ -2673,10 +2639,7 @@ clear_storage_via_libcall (rtx object, rtx size)
 
   object = copy_to_mode_reg (Pmode, XEXP (object, 0));
 
-  if (TARGET_MEM_FUNCTIONS)
-    size_mode = TYPE_MODE (sizetype);
-  else
-    size_mode = TYPE_MODE (unsigned_type_node);
+  size_mode = TYPE_MODE (sizetype);
   size = convert_to_mode (size_mode, size, 1);
   size = copy_to_mode_reg (size_mode, size);
 
@@ -2684,20 +2647,14 @@ clear_storage_via_libcall (rtx object, rtx size)
      memset in this context.  This could be a user call to memset and
      the user may wish to examine the return value from memset.  For
      targets where libcalls and normal calls have different conventions
-     for returning pointers, we could end up generating incorrect code.
-
-     For convenience, we generate the call to bzero this way as well.  */
+     for returning pointers, we could end up generating incorrect code.  */
 
   object_tree = make_tree (ptr_type_node, object);
-  if (TARGET_MEM_FUNCTIONS)
-    size_tree = make_tree (sizetype, size);
-  else
-    size_tree = make_tree (unsigned_type_node, size);
+  size_tree = make_tree (sizetype, size);
 
   fn = clear_storage_libcall_fn (true);
   arg_list = tree_cons (NULL_TREE, size_tree, NULL_TREE);
-  if (TARGET_MEM_FUNCTIONS)
-    arg_list = tree_cons (NULL_TREE, integer_zero_node, arg_list);
+  arg_list = tree_cons (NULL_TREE, integer_zero_node, arg_list);
   arg_list = tree_cons (NULL_TREE, object_tree, arg_list);
 
   /* Now we have to build up the CALL_EXPR itself.  */
@@ -2713,7 +2670,7 @@ clear_storage_via_libcall (rtx object, rtx size)
   if (RTX_UNCHANGING_P (object))
     emit_insn (gen_rtx_CLOBBER (VOIDmode, object));
 
-  return (TARGET_MEM_FUNCTIONS ? retval : NULL_RTX);
+  return retval;
 }
 
 /* A subroutine of clear_storage_via_libcall.  Create the tree node
@@ -2729,19 +2686,10 @@ init_block_clear_fn (const char *asmspec)
     {
       tree fn, args;
 
-      if (TARGET_MEM_FUNCTIONS)
-       {
-         fn = get_identifier ("memset");
-         args = build_function_type_list (ptr_type_node, ptr_type_node,
-                                          integer_type_node, sizetype,
-                                          NULL_TREE);
-       }
-      else
-       {
-         fn = get_identifier ("bzero");
-         args = build_function_type_list (void_type_node, ptr_type_node,
-                                          unsigned_type_node, NULL_TREE);
-       }
+      fn = get_identifier ("memset");
+      args = build_function_type_list (ptr_type_node, ptr_type_node,
+                                      integer_type_node, sizetype,
+                                      NULL_TREE);
 
       fn = build_decl (FUNCTION_DECL, fn, args);
       DECL_EXTERNAL (fn) = 1;
@@ -4029,21 +3977,12 @@ expand_assignment (tree to, tree from, int want_value)
       size = expr_size (from);
       from_rtx = expand_expr (from, NULL_RTX, VOIDmode, 0);
 
-      if (TARGET_MEM_FUNCTIONS)
-       emit_library_call (memmove_libfunc, LCT_NORMAL,
-                          VOIDmode, 3, XEXP (to_rtx, 0), Pmode,
-                          XEXP (from_rtx, 0), Pmode,
-                          convert_to_mode (TYPE_MODE (sizetype),
-                                           size, TYPE_UNSIGNED (sizetype)),
-                          TYPE_MODE (sizetype));
-      else
-        emit_library_call (bcopy_libfunc, LCT_NORMAL,
-                          VOIDmode, 3, XEXP (from_rtx, 0), Pmode,
-                          XEXP (to_rtx, 0), Pmode,
-                          convert_to_mode (TYPE_MODE (integer_type_node),
-                                           size,
-                                           TYPE_UNSIGNED (integer_type_node)),
-                          TYPE_MODE (integer_type_node));
+      emit_library_call (memmove_libfunc, LCT_NORMAL,
+                        VOIDmode, 3, XEXP (to_rtx, 0), Pmode,
+                        XEXP (from_rtx, 0), Pmode,
+                        convert_to_mode (TYPE_MODE (sizetype),
+                                         size, TYPE_UNSIGNED (sizetype)),
+                        TYPE_MODE (sizetype));
 
       preserve_temp_slots (to_rtx);
       free_temp_slots ();
@@ -5207,10 +5146,10 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
         and then "or" in whatever non-constant ranges we need in addition.
 
         If a large set is all zero or all ones, it is
-        probably better to set it using memset (if available) or bzero.
+        probably better to set it using memset.
         Also, if a large set has just a single range, it may also be
         better to first clear all the first clear the set (using
-        bzero/memset), and set the bits we want.  */
+        memset), and set the bits we want.  */
 
       /* Check for all zeros.  */
       if (elt == NULL_TREE && size > 0)
@@ -5342,8 +5281,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
 
          /* Optimization:  If startbit and endbit are constants divisible
             by BITS_PER_UNIT, call memset instead.  */
-         if (TARGET_MEM_FUNCTIONS
-             && TREE_CODE (startbit) == INTEGER_CST
+         if (TREE_CODE (startbit) == INTEGER_CST
              && TREE_CODE (endbit) == INTEGER_CST
              && (startb = TREE_INT_CST_LOW (startbit)) % BITS_PER_UNIT == 0
              && (endb = TREE_INT_CST_LOW (endbit) + 1) % BITS_PER_UNIT == 0)
index 1a9fe47490f485d980200acdbc38ae6b9f9ea033..32cde82c185dd52c3c4ade9ea2ed2daabbc078ad 100644 (file)
@@ -27,11 +27,8 @@ enum libfunc_index
   LTI_abort,
   LTI_memcpy,
   LTI_memmove,
-  LTI_bcopy,
   LTI_memcmp,
-  LTI_bcmp,
   LTI_memset,
-  LTI_bzero,
   LTI_setbits,
 
   LTI_unwind_resume,
@@ -58,11 +55,8 @@ extern GTY(()) rtx libfunc_table[LTI_MAX];
 #define abort_libfunc  (libfunc_table[LTI_abort])
 #define memcpy_libfunc (libfunc_table[LTI_memcpy])
 #define memmove_libfunc        (libfunc_table[LTI_memmove])
-#define bcopy_libfunc  (libfunc_table[LTI_bcopy])
 #define memcmp_libfunc (libfunc_table[LTI_memcmp])
-#define bcmp_libfunc   (libfunc_table[LTI_bcmp])
 #define memset_libfunc (libfunc_table[LTI_memset])
-#define bzero_libfunc  (libfunc_table[LTI_bzero])
 #define setbits_libfunc        (libfunc_table[LTI_setbits])
 
 #define unwind_resume_libfunc  (libfunc_table[LTI_unwind_resume])
index 1ef656d0eb1faecedf691f6d45f42d5942c27b54..021033113e5f3cfb60e3b019ac2bef97236b48c4 100644 (file)
@@ -3744,15 +3744,9 @@ prepare_cmp_insn (rtx *px, rtx *py, enum rtx_code *pcomparison, rtx size,
          return;
        }
 
-      /* Otherwise call a library function, memcmp if we've got it,
-        bcmp otherwise.  */
-#ifdef TARGET_MEM_FUNCTIONS
+      /* Otherwise call a library function, memcmp.  */
       libfunc = memcmp_libfunc;
       length_type = sizetype;
-#else
-      libfunc = bcmp_libfunc;
-      length_type = integer_type_node;
-#endif
       result_mode = TYPE_MODE (integer_type_node);
       cmp_mode = TYPE_MODE (length_type);
       size = convert_to_mode (TYPE_MODE (length_type), size,
@@ -5522,11 +5516,8 @@ init_optabs (void)
   abort_libfunc = init_one_libfunc ("abort");
   memcpy_libfunc = init_one_libfunc ("memcpy");
   memmove_libfunc = init_one_libfunc ("memmove");
-  bcopy_libfunc = init_one_libfunc ("bcopy");
   memcmp_libfunc = init_one_libfunc ("memcmp");
-  bcmp_libfunc = init_one_libfunc ("__gcc_bcmp");
   memset_libfunc = init_one_libfunc ("memset");
-  bzero_libfunc = init_one_libfunc ("bzero");
   setbits_libfunc = init_one_libfunc ("__setbits");
 
   unwind_resume_libfunc = init_one_libfunc (USING_SJLJ_EXCEPTIONS
index 1c2bbbe78f7527285172d85fc14671d10abbd6b2..90d906b3b3a078d99155efdc534c41b7e235f9d8 100644 (file)
@@ -618,7 +618,7 @@ extern int snprintf (char *, size_t, const char *, ...);
        DBX_OUTPUT_STANDARD_TYPES BUILTIN_SETJMP_FRAME_VALUE               \
        SUNOS4_SHARED_LIBRARIES PROMOTE_FOR_CALL_ONLY                      \
        SPACE_AFTER_L_OPTION NO_RECURSIVE_FUNCTION_CSE                     \
-       DEFAULT_MAIN_RETURN
+       DEFAULT_MAIN_RETURN TARGET_MEM_FUNCTIONS
 
 /* Hooks that are no longer used.  */
  #pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE  \