diff options
author | Alexandre Oliva <oliva@dcc.unicamp.br> | 1999-08-25 21:55:16 +0000 |
---|---|---|
committer | no-author <no-author@gcc.gnu.org> | 1999-08-25 21:55:16 +0000 |
commit | 610e72e17f93a283b70843cc20e0d1a37df90fe1 (patch) | |
tree | 5c30614e286d1ba5f0a6ebcc1c78814482dfec30 | |
parent | 635f81109a1e1449eb551a30f7ac5c5fb7c88f12 (diff) |
This commit was manufactured by cvs2svn to create branch
'new_ia32_branch'.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/new_ia32_branch@28875 138bc75d-0d04-0410-961f-82ee72b054a4
47 files changed, 1515 insertions, 0 deletions
diff --git a/contrib/gcc_update b/contrib/gcc_update new file mode 100755 index 00000000000..e7fa727d61b --- /dev/null +++ b/contrib/gcc_update @@ -0,0 +1,202 @@ +#! /bin/sh +# +# Update a local CVS tree from the egcs repository, with an emphasis +# on treating generated files correctly, so that autoconf, bison et +# al are not required for the ``end'' user. +# +# By default all command-line options are passed to `cvs update` in +# addition to $UPDATE_OPTIONS (defined below). If the first parameter +# reads --nostdflags, $UPDATE_OPTIONS as well as this parameter itself +# are omitted. +# +# If the first parameter reads --patch, the second parameter is considered +# a patch file. +# +# If the first parameter is --touch, no cvs operation will be performed, +# only generated files that appear to be out of date in the local tree +# will be touched. +# +# If the first parameter is --list, a list of the generated files and +# their dependencies will be printed; --help prints this message. +# +# Examples: +# +# contrib/egcs_update -r egcs_latest_snapshot +# contrib/egcs_update -A +# contrib/egcs_update --nostdflags -P -r egcs_1_1_branch gcc/testsuite +# contrib/egcs_update --patch some-patch +# contrib/egcs_update --touch +# contrib/egcs_update --list +# +# +# (C) 1998-1999 Free Software Foundation +# Originally by Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>, August 1998. +# +# This script is Free Software, and it can be copied, distributed and +# modified as defined in the GNU General Public License. A copy of +# its license can be downloaded from http://www.gnu.org/copyleft/gpl.html + + +# Default options used when updating via CVS. +UPDATE_OPTIONS=-P +# Add -d to create any directories that exist in the repository but not +# locally. +# Add -A to reset any sticky tags, dates, or `-k' options. + + +# This function prints a list of all generated files, along with their +# dependencies. Note that only one target is supported per line: the +# colon is stripped from the output. +files_and_dependencies () { + sed -e 's/ *#.*//' -e '/^$/d' -e 's/://' <<\EOF +# All automake dependencies within texinfo +# In fact, not all, since we do not care about sub-directories that +# we do not build. In particular, *.po and *.gmo are not touched. +texinfo/aclocal.m4: texinfo/configure.in texinfo/acinclude.m4 +texinfo/Makefile.in: texinfo/Makefile.am texinfo/configure.in texinfo/aclocal.m4 +texinfo/configure: texinfo/configure.in texinfo/aclocal.m4 +texinfo/stamp-h.in: texinfo/configure.in texinfo/aclocal.m4 texinfo/acconfig.h +texinfo/lib/Makefile.in: texinfo/lib/Makefile.am texinfo/configure.in texinfo/aclocal.m4 +texinfo/makeinfo/Makefile.in: texinfo/makeinfo/Makefile.am texinfo/configure.in texinfo/aclocal.m4 +texinfo/util/Makefile.in: texinfo/util/Makefile.am texinfo/configure.in texinfo/aclocal.m4 +# Now, proceed to gcc automatically generated files +gcc/configure: gcc/configure.in +gcc/cstamp-h.in: gcc/configure.in gcc/acconfig.h +gcc/config.in: gcc/cstamp-h.in +gcc/c-parse.y: gcc/c-parse.in +gcc/c-parse.c: gcc/c-parse.y +gcc/c-parse.h: gcc/c-parse.c +gcc/c-gperf.h: gcc/c-parse.gperf +gcc/cexp.c: gcc/cexp.y +gcc/fixinc/fixincl.x: gcc/fixinc/fixincl.tpl gcc/fixinc/inclhack.def +gcc/fixinc/inclhack.sh: gcc/fixinc/inclhack.def gcc/fixinc/inclhack.tpl gcc/fixinc/hackshell.tpl +gcc/fixinc/fixincl.sh: gcc/fixinc/inclhack.def gcc/fixinc/inclhack.tpl +# And then, language-specific files +gcc/cp/parse.c: gcc/cp/parse.y +gcc/cp/parse.h: gcc/cp/parse.c +gcc/objc/objc-parse.y: gcc/c-parse.in +gcc/objc/objc-parse.c: gcc/objc/objc-parse.y +gcc/java/parse.h: gcc/java/parse.y +gcc/java/parse.c: gcc/java/parse.y gcc/java/lex.c gcc/java/parse.h gcc/java/lex.h +gcc/java/parse-scan.c: gcc/java/parse-scan.y gcc/java/lex.c gcc/java/parse.h gcc/java/lex.h +# And libraries, at last +libchill/configure: libchill/configure.in +libf2c/configure: libf2c/configure.in +libf2c/libF77/configure: libf2c/libF77/configure.in +libf2c/libI77/configure: libf2c/libI77/configure.in +libf2c/libU77/configure: libf2c/libU77/configure.in +libf2c/libU77/stamp-h.in: libf2c/libU77/configure.in libf2c/libU77/acconfig.h +libobjc/configure: libobjc/configure.in +EOF +} + + +# This function checks whether its first argument is newer than all +# the other arguments. It returns success (0) otherwise. +is_out_of_date () { + test `ls -1dt ${1+"$@"} | sed 1q` != "$1" +} + + +# This function touches generated files such that the ``end'' user does +# not have to rebuild them. +touch_files () { + files_and_dependencies | while read f deps; do + if test -f $f && is_out_of_date "$f" $deps; then + echo Touching "$f"... + touch $f + if is_out_of_date "$f" $deps; then + # Hmm, it may have got the same timestamp as one of + # its touched dependencies. Wait a second and retry + sleep 1 + touch $f + fi + fi + done +} + + +# This functions applies a patch to an existing tree. +apply_patch () { + if [ -f $1 ]; then + echo "Applying patch file $1" + case "$1" in + *gz) + gzip -d -c $1 | patch -p1 ;; + *) + cat $1 | patch -p1 ;; + esac + fi + echo "Adjusting file timestamps" + touch_files +} + +# Check whether this indeed looks like a local tree. +if [ ! -f gcc/version.c ]; then + echo "This does not seem to be an egcs tree!" + exit +fi + +case "$1" in +# First of all, check whether we are going to process a patch. +--patch) + if test "$#" != 2; then + echo "$1" expects only one argument >&2 + exit 1 + fi + apply_patch "${2}" + exit $? + ;; + +--touch) + if test "$#" != 1; then + echo "$1" does not expect any argument >&2 + exit 1 + fi + touch_files + exit $? + ;; + +--list) + if test "$#" != 1; then + echo "$1" does not expect any argument >&2 + exit 1 + fi + files_and_dependencies | sed 's/ /: /' + exit $? + ;; + +--help) + sed -e '1,2d' -e '/^UPDATE_OPTIONS=/{i\ +\ + +p +}' \ + -e '/^$/,$d' -e 's/#//' -e 's/^ //' < $0 + exit $? + ;; + +esac + +# Check whether this indeed looks like a local CVS tree. +if [ ! -d CVS ]; then + echo "This does not seem to be an egcs CVS tree!" + exit +fi + +# Check command-line options +if [ x"${1}"x = x"--nostdflags"x ]; then + shift +else + set -- $UPDATE_OPTIONS ${1+"$@"} +fi + +echo "Updating CVS tree" +cvs -q update ${1+"$@"} +if [ $? -ne 0 ]; then + echo "CVS update of full tree failed." >&2 + exit 1 +fi + +echo "Adjusting file timestamps" +touch_files diff --git a/gcc/config/arm/linux-oldld.h b/gcc/config/arm/linux-oldld.h new file mode 100644 index 00000000000..8b2af015efe --- /dev/null +++ b/gcc/config/arm/linux-oldld.h @@ -0,0 +1,27 @@ +/* Definitions for ARM running Linux-based GNU systems + using ELF with old binutils. + Copyright (C) 1999 Free Software Foundation, Inc. + Contributed by Philip Blundell <Philip.Blundell@pobox.com> + +This file is part of GNU CC. + +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +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. */ + +/* Unfortunately, owing to various historical accidents, version 2.9.4 + and newer of GNU binutils are not quite compatible with the old + (2.9.1-based) toolset. This tells linux-elf.h to generate specs + appropriate for the older versions. */ +#define SUBTARGET_OLD_LINKER diff --git a/gcc/config/float-sparc.h b/gcc/config/float-sparc.h new file mode 100644 index 00000000000..b7356ad3d54 --- /dev/null +++ b/gcc/config/float-sparc.h @@ -0,0 +1,122 @@ +/* float.h for target with IEEE 32, 64 and 128 bit SPARC floating point formats + (on sparc-linux long double is 64 bit, while on sparc64-linux 128 bit) */ +#ifndef _FLOAT_H_ +#define _FLOAT_H_ +/* Produced by enquire version 4.3, CWI, Amsterdam */ + + /* Radix of exponent representation */ +#undef FLT_RADIX +#define FLT_RADIX 2 + /* Number of base-FLT_RADIX digits in the significand of a float */ +#undef FLT_MANT_DIG +#define FLT_MANT_DIG 24 + /* Number of decimal digits of precision in a float */ +#undef FLT_DIG +#define FLT_DIG 6 + /* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown */ +#undef FLT_ROUNDS +#define FLT_ROUNDS 1 + /* Difference between 1.0 and the minimum float greater than 1.0 */ +#undef FLT_EPSILON +#define FLT_EPSILON 1.19209290e-07F + /* Minimum int x such that FLT_RADIX**(x-1) is a normalised float */ +#undef FLT_MIN_EXP +#define FLT_MIN_EXP (-125) + /* Minimum normalised float */ +#undef FLT_MIN +#define FLT_MIN 1.17549435e-38F + /* Minimum int x such that 10**x is a normalised float */ +#undef FLT_MIN_10_EXP +#define FLT_MIN_10_EXP (-37) + /* Maximum int x such that FLT_RADIX**(x-1) is a representable float */ +#undef FLT_MAX_EXP +#define FLT_MAX_EXP 128 + /* Maximum float */ +#undef FLT_MAX +#define FLT_MAX 3.40282347e+38F + /* Maximum int x such that 10**x is a representable float */ +#undef FLT_MAX_10_EXP +#define FLT_MAX_10_EXP 38 + + /* Number of base-FLT_RADIX digits in the significand of a double */ +#undef DBL_MANT_DIG +#define DBL_MANT_DIG 53 + /* Number of decimal digits of precision in a double */ +#undef DBL_DIG +#define DBL_DIG 15 + /* Difference between 1.0 and the minimum double greater than 1.0 */ +#undef DBL_EPSILON +#define DBL_EPSILON 2.2204460492503131e-16 + /* Minimum int x such that FLT_RADIX**(x-1) is a normalised double */ +#undef DBL_MIN_EXP +#define DBL_MIN_EXP (-1021) + /* Minimum normalised double */ +#undef DBL_MIN +#define DBL_MIN 2.2250738585072014e-308 + /* Minimum int x such that 10**x is a normalised double */ +#undef DBL_MIN_10_EXP +#define DBL_MIN_10_EXP (-307) + /* Maximum int x such that FLT_RADIX**(x-1) is a representable double */ +#undef DBL_MAX_EXP +#define DBL_MAX_EXP 1024 + /* Maximum double */ +#undef DBL_MAX +#define DBL_MAX 1.7976931348623157e+308 + /* Maximum int x such that 10**x is a representable double */ +#undef DBL_MAX_10_EXP +#define DBL_MAX_10_EXP 308 + +#if defined(__sparc_v9__) || defined(__sparcv9) || defined(__arch64__) + + /* Number of base-FLT_RADIX digits in the significand of a long double */ +#undef LDBL_MANT_DIG +#define LDBL_MANT_DIG 113 + /* Number of decimal digits of precision in a long double */ +#undef LDBL_DIG +#define LDBL_DIG 33 + /* Difference between 1.0 and the minimum long double greater than 1.0 */ +#undef LDBL_EPSILON +#define LDBL_EPSILON 1.925929944387235853055977942584927319E-34L + /* Minimum int x such that FLT_RADIX**(x-1) is a normalised long double */ +#undef LDBL_MIN_EXP +#define LDBL_MIN_EXP (-16381) + /* Minimum normalised long double */ +#undef LDBL_MIN +#define LDBL_MIN 3.362103143112093506262677817321752603E-4932L + /* Minimum int x such that 10**x is a normalised long double */ +#undef LDBL_MIN_10_EXP +#define LDBL_MIN_10_EXP (-4931) + /* Maximum int x such that FLT_RADIX**(x-1) is a representable long double */ +#undef LDBL_MAX_EXP +#define LDBL_MAX_EXP 16384 + /* Maximum long double */ +#undef LDBL_MAX +#define LDBL_MAX 1.189731495357231765085759326628007016E+4932L + /* Maximum int x such that 10**x is a representable long double */ +#undef LDBL_MAX_10_EXP +#define LDBL_MAX_10_EXP 4932 + +#else /* sparc32 */ + +#undef LDBL_MANT_DIG +#define LDBL_MANT_DIG DBL_MANT_DIG +#undef LDBL_DIG +#define LDBL_DIG DBL_DIG +#undef LDBL_EPSILON +#define LDBL_EPSILON DBL_EPSILON +#undef LDBL_MIN_EXP +#define LDBL_MIN_EXP DBL_MIN_EXP +#undef LDBL_MIN +#define LDBL_MIN DBL_MIN +#undef LDBL_MIN_10_EXP +#define LDBL_MIN_10_EXP DBL_MIN_10_EXP +#undef LDBL_MAX_EXP +#define LDBL_MAX_EXP DBL_MAX_EXP +#undef LDBL_MAX +#define LDBL_MAX DBLX_MAX +#undef LDBL_MAX_10_EXP +#define LDBL_MAX_10_EXP DBL_MAX_10_EXP + +#endif /* sparc32 */ + +#endif /* _FLOAT_H_ */ diff --git a/gcc/config/sparc/liteelf.h b/gcc/config/sparc/liteelf.h new file mode 100644 index 00000000000..3eedce4c4c3 --- /dev/null +++ b/gcc/config/sparc/liteelf.h @@ -0,0 +1,49 @@ +/* Definitions of target machine for GNU compiler, for SPARClite w/o FPU. + Copyright (C) 1998, 1999 Free Software Foundation, Inc. + Contributed by Stan Cox (scox@cygnus.com). + +This file is part of GNU CC. + +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +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. */ + +#include "sparc/elf.h" + +#undef CPP_PREDEFINES +#define CPP_PREDEFINES "-D__sparc__ -D__sparclite__ -Acpu(sparc) -Amachine(sparc)" + +/* Default to dwarf2 in ELF. */ + +#define DWARF_DEBUGGING_INFO +#define DWARF2_DEBUGGING_INFO + +#undef PREFERRED_DEBUGGING_TYPE +#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG + +#undef TARGET_VERSION +#define TARGET_VERSION fprintf (stderr, " (sparclite)"); + +/* Enable app-regs and epilogue options. Do not enable the fpu. */ + +#undef TARGET_DEFAULT +#define TARGET_DEFAULT (MASK_APP_REGS + MASK_EPILOGUE) + +/* US Software GOFAST library support. */ +#include "gofast.h" +#undef INIT_SUBTARGET_OPTABS +#define INIT_SUBTARGET_OPTABS INIT_GOFAST_OPTABS + +#undef STARTFILE_SPEC +#define STARTFILE_SPEC "crti.o%s crtbegin.o%s" diff --git a/gcc/config/sparc/sp86x-aout.h b/gcc/config/sparc/sp86x-aout.h new file mode 100644 index 00000000000..e4f2dcc1ffe --- /dev/null +++ b/gcc/config/sparc/sp86x-aout.h @@ -0,0 +1,60 @@ +/* Definitions of target machine for GNU compiler, for sparclite 86x w/o FPU. + Copyright (C) 1998, 1999 Free Software Foundation, Inc. + +This file is part of GNU CC. + +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +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. */ + +#include "sparc/sparc.h" + +#define HAVE_ATEXIT + +#undef CPP_PREDEFINES +#define CPP_PREDEFINES "-D__sparc__ -D__sparclite86x__ -Acpu(sparc) -Amachine(sparc)" + +#undef TARGET_VERSION +#define TARGET_VERSION fprintf (stderr, " (sparclite 86x)"); + +/* Enable app-regs and epilogue options. Do not enable the fpu. */ + +#undef TARGET_DEFAULT +#define TARGET_DEFAULT (MASK_APP_REGS + MASK_EPILOGUE) + +#undef SUBTARGET_SWITCHES +#define SUBTARGET_SWITCHES \ +{"big-endian", -MASK_LITTLE_ENDIAN}, \ +{"little-endian", MASK_LITTLE_ENDIAN}, + +#undef ASM_SPEC +#define ASM_SPEC "%{v:-v} %{mlittle-endian-data:--little-endian-data} %(asm_cpu)" + +/* US Software GOFAST library support. */ +#include "gofast.h" +#undef INIT_SUBTARGET_OPTABS +#define INIT_SUBTARGET_OPTABS INIT_GOFAST_OPTABS + +#undef LINK_SPEC +#define LINK_SPEC "%{v:-V}" + +#undef BYTES_BIG_ENDIAN +#define BYTES_BIG_ENDIAN (! TARGET_LITTLE_ENDIAN_DATA) +#undef WORDS_BIG_ENDIAN +#define WORDS_BIG_ENDIAN (! TARGET_LITTLE_ENDIAN_DATA) + +#define TARGET_LITTLE_ENDIAN_DATA (target_flags & MASK_LITTLE_ENDIAN) +#undef SUBTARGET_SWITCHES +#define SUBTARGET_SWITCHES \ + { "little-endian-data", MASK_LITTLE_ENDIAN }, diff --git a/gcc/config/sparc/sp86x-elf.h b/gcc/config/sparc/sp86x-elf.h new file mode 100644 index 00000000000..0ecaba1c8d0 --- /dev/null +++ b/gcc/config/sparc/sp86x-elf.h @@ -0,0 +1,73 @@ +/* Definitions of target machine for GNU compiler, for sparclite 86x w/o FPU. + Copyright (C) 1998, 1999 Free Software Foundation, Inc. + Contributed by Stan Cox (scox@cygnus.com). + +This file is part of GNU CC. + +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +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. */ + +#include "sparc/elf.h" + +#undef CPP_PREDEFINES +#define CPP_PREDEFINES "-D__sparc__ -D__sparclite86x__ -Acpu(sparc) -Amachine(sparc)" + +/* Default to dwarf2 in ELF. */ + +#define DWARF_DEBUGGING_INFO +#define DWARF2_DEBUGGING_INFO + +#undef PREFERRED_DEBUGGING_TYPE +#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG + +#undef TARGET_VERSION +#define TARGET_VERSION fprintf (stderr, " (sparclite 86x)"); + +/* Enable app-regs and epilogue options. Do not enable the fpu. */ + +#undef TARGET_DEFAULT +#define TARGET_DEFAULT (MASK_APP_REGS + MASK_EPILOGUE) + +#undef SUBTARGET_SWITCHES +#define SUBTARGET_SWITCHES \ +{"big-endian", -MASK_LITTLE_ENDIAN}, \ +{"little-endian", MASK_LITTLE_ENDIAN}, + +#undef ASM_SPEC +#define ASM_SPEC "%{v:-V} %{mlittle-endian-data:--little-endian-data} %(asm_cpu)" + +/* US Software GOFAST library support. */ +#include "gofast.h" +#undef INIT_SUBTARGET_OPTABS +#define INIT_SUBTARGET_OPTABS INIT_GOFAST_OPTABS + +#undef STARTFILE_SPEC +#define STARTFILE_SPEC "crti.o%s crtbegin.o%s" + +#undef LINK_SPEC +#define LINK_SPEC "%{v:-V} %{mlittle-endian-data:-EL}" + +#undef BYTES_BIG_ENDIAN +#define BYTES_BIG_ENDIAN (! TARGET_LITTLE_ENDIAN_DATA) +#undef WORDS_BIG_ENDIAN +#define WORDS_BIG_ENDIAN (! TARGET_LITTLE_ENDIAN_DATA) + +/* Use __main method of constructor invocation */ +#undef INIT_SECTION_ASM_OP + +#define TARGET_LITTLE_ENDIAN_DATA (target_flags & MASK_LITTLE_ENDIAN) +#undef SUBTARGET_SWITCHES +#define SUBTARGET_SWITCHES \ + { "little-endian-data", MASK_LITTLE_ENDIAN }, diff --git a/gcc/config/sparc/t-sp86x b/gcc/config/sparc/t-sp86x new file mode 100644 index 00000000000..13bc9e709bf --- /dev/null +++ b/gcc/config/sparc/t-sp86x @@ -0,0 +1,24 @@ +CROSS_LIBGCC1 = libgcc1-asm.a +LIB1ASMSRC = sparc/lb1spc.asm +LIB1ASMFUNCS = _divsi3 _modsi3 + +# We want fine grained libraries, so use the new code to build the +# floating point emulation libraries. +FPBIT = fp-bit.c +DPBIT = dp-bit.c + +dp-bit.c: $(srcdir)/config/fp-bit.c + echo '#define US_SOFTWARE_GOFAST' > dp-bit.c + cat $(srcdir)/config/fp-bit.c >> dp-bit.c + +fp-bit.c: $(srcdir)/config/fp-bit.c + echo '#define FLOAT' > fp-bit.c + echo '#define US_SOFTWARE_GOFAST' >> fp-bit.c + cat $(srcdir)/config/fp-bit.c >> fp-bit.c + +MULTILIB_OPTIONS = mlittle-endian-data +MULTILIB_DIRNAMES = little + +LIBGCC = stmp-multilib +INSTALL_LIBGCC = install-multilib + diff --git a/gcc/lists.c b/gcc/lists.c new file mode 100644 index 00000000000..331b9538b3d --- /dev/null +++ b/gcc/lists.c @@ -0,0 +1,150 @@ +/* List management for the GNU C-Compiler expander. + Copyright (C) 1987, 88, 92-97, 1998, 1999 Free Software Foundation, Inc. + +This file is part of GNU CC. + +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +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. */ + +#include "config.h" +#include "system.h" +#include "toplev.h" +#include "rtl.h" + +/* Functions for maintaining cache-able lists of EXPR_LIST and INSN_LISTs. */ + +/* An INSN_LIST containing all INSN_LISTs allocated but currently unused. */ +static rtx unused_insn_list; + +/* An EXPR_LIST containing all EXPR_LISTs allocated but currently unused. */ +static rtx unused_expr_list; + + +/* This function will free an entire list of either EXPR_LIST or INSN_LIST + nodes. This is to be used only only lists that consist exclusively of + nodes of one type only. This is only called by free_EXPR_LIST_list + and free_INSN_LIST_list. */ +static void +free_list (listp, unused_listp) + rtx *listp, *unused_listp; +{ + register rtx link, prev_link; + + prev_link = *listp; + link = XEXP (prev_link, 1); + + while (link) + { + prev_link = link; + link = XEXP (link, 1); + } + + XEXP (prev_link, 1) = *unused_listp; + *unused_listp = *listp; + *listp = 0; +} + +/* This call is used in place of a gen_rtx_INSN_LIST. If there is a cached + node available, we'll use it, otherwise a call to gen_rtx_INSN_LIST + is made. */ +rtx +alloc_INSN_LIST (val, next) + rtx val, next; +{ + rtx r; + + if (unused_insn_list) + { + r = unused_insn_list; + unused_insn_list = XEXP (r, 1); + XEXP (r, 0) = val; + XEXP (r, 1) = next; + PUT_REG_NOTE_KIND (r, VOIDmode); + } + else + r = gen_rtx_INSN_LIST (VOIDmode, val, next); + + return r; +} + +/* This call is used in place of a gen_rtx_EXPR_LIST. If there is a cached + node available, we'll use it, otherwise a call to gen_rtx_EXPR_LIST + is made. */ +rtx +alloc_EXPR_LIST (kind, val, next) + int kind; + rtx val, next; +{ + rtx r; + + if (unused_expr_list) + { + r = unused_expr_list; + unused_expr_list = XEXP (r, 1); + XEXP (r, 0) = val; + XEXP (r, 1) = next; + PUT_REG_NOTE_KIND (r, kind); + } + else + r = gen_rtx_EXPR_LIST (kind, val, next); + + return r; +} + +/* This function will initialize the EXPR_LIST and INSN_LIST caches. */ +void +init_EXPR_INSN_LIST_cache () +{ + unused_expr_list = NULL; + unused_insn_list = NULL; +} + +/* This function will free up an entire list of EXPR_LIST nodes. */ +void +free_EXPR_LIST_list (listp) + rtx *listp; +{ + if (*listp == 0) + return; + free_list (listp, &unused_expr_list); +} + +/* This function will free up an entire list of INSN_LIST nodes. */ +void +free_INSN_LIST_list (listp) + rtx *listp; +{ + if (*listp == 0) + return; + free_list (listp, &unused_insn_list); +} + +/* This function will free up an individual EXPR_LIST node. */ +void +free_EXPR_LIST_node (ptr) + rtx ptr; +{ + XEXP (ptr, 1) = unused_expr_list; + unused_expr_list = ptr; +} + +/* This function will free up an individual INSN_LIST node. */ +void +free_INSN_LIST_node (ptr) + rtx ptr; +{ + XEXP (ptr, 1) = unused_insn_list; + unused_insn_list = ptr; +} diff --git a/gcc/testsuite/g++.old-deja/g++.eh/cond1.C b/gcc/testsuite/g++.old-deja/g++.eh/cond1.C new file mode 100644 index 00000000000..67b66ca61ad --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.eh/cond1.C @@ -0,0 +1,31 @@ +// Build don't link: + +// Copyright (C) 1999 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 11 Apr 1999 <nathan@acm.org> +// Derived from bug report from Gabriel Dos Reis +// <Gabriel.Dos-Reis@cmla.ens-cachan.fr> +// http://egcs.cygnus.com/ml/egcs-bugs/1999-03/msg00883.html + +// conditional exprs have some funny rules when one of the types is void. +// [expr.cond] 5.16, make sure we do the right things +// We implement an extension, allowing one side to be void, check we +// pedantically moan. + +struct X {}; +void fn(int i) +{ + int j; + + j = (i ? throw X() : 1); // ok, int + j = (i ? 1 : throw X()); // ok, int + + (i ? throw X() : throw X()); // ok, void + + (i ? i : j) = 1; // ok, int & + (i ? throw X() : j) = 1; // ERROR - non-lvalue + (i ? j : throw X()) = 1; // ERROR - non-lvalue + (i ? throw X() : throw X()) = 1; // ERROR - void + + (i ? (void)1 : i++); // ERROR - ANSI forbids + (i ? i++ : (void)1); // ERROR - ANSI forbids +} diff --git a/gcc/testsuite/g++.old-deja/g++.eh/fntry1.C b/gcc/testsuite/g++.old-deja/g++.eh/fntry1.C new file mode 100644 index 00000000000..9c1c0ff0a79 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.eh/fntry1.C @@ -0,0 +1,31 @@ +// Bug: g++ fails to treat function-try-blocks in ctors specially. +// Submitted by Jason Merrill <jason@cygnus.com> + +int c; +int r; + +struct A { + int i; + A(int j) { i = j; } + ~A() { c += i; } +}; + +struct B: public A { + A a; + B() try : A(1), a(2) + { throw 1; } + catch (...) + { if (c != 3) r |= 1; } +}; + +int main () +{ + try + { B b; } + catch (...) + { c = 0; } + + if (c != 0) r |= 2; + + return r; +} diff --git a/gcc/testsuite/g++.old-deja/g++.martin/eval1.C b/gcc/testsuite/g++.old-deja/g++.martin/eval1.C new file mode 100644 index 00000000000..e8a19f6296c --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.martin/eval1.C @@ -0,0 +1,21 @@ +// Postfix expression must be evaluated even if accessing a static member. +// execution test - XFAIL *-*-* + +struct S +{ + static int i; + S* foo(); +}; + +S* S::foo(){ + i = 0; + return this; +}; + +int S::i = 1; +int main(void) +{ + S * s = new S; + int k=(s->foo())->i; + return k; +} diff --git a/gcc/testsuite/g++.old-deja/g++.ns/template12.C b/gcc/testsuite/g++.old-deja/g++.ns/template12.C new file mode 100644 index 00000000000..5a6869cb4e1 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.ns/template12.C @@ -0,0 +1,19 @@ +// Build don't link: +// Templates can be defined outside of the namespace if the have been declared +// inside +namespace bar +{ + template <typename T> + T const foo(T const &); + template<> const int foo<int>(int const &); +} + +template <typename T> +T const +bar::foo(T const &a) +{ + return a; +} + +template<> const int bar::foo<int>(int const &){return 0;} + diff --git a/gcc/testsuite/g++.old-deja/g++.ns/template13.C b/gcc/testsuite/g++.old-deja/g++.ns/template13.C new file mode 100644 index 00000000000..193451e3d08 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.ns/template13.C @@ -0,0 +1,22 @@ +// Build don't link: +// Templates defined outside must be declared inside +namespace bar +{ + template<class T> + void foo(); // trick it to provide some prior declaration + template<class T>class X; +} + +template <typename T> +T const +bar::foo(T const &a) +{ // ERROR - not declared in bar - XFAIL *-*-* + return a; +} + +template<> void bar::foo<int>() +{ // ERROR - not declared in bar - XFAIL *-*-* +} + +template<class T,class U> +class bar::X{}; // ERROR - does not match declaration - XFAIL *-*-* diff --git a/gcc/testsuite/g++.old-deja/g++.oliva/ChangeLog b/gcc/testsuite/g++.old-deja/g++.oliva/ChangeLog new file mode 100644 index 00000000000..5a5ab8a48ee --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.oliva/ChangeLog @@ -0,0 +1,70 @@ +1999-08-25 Alexandre Oliva <oliva@dcc.unicamp.br> + + * thunk1.C: New test. + +1999-08-06 Alexandre Oliva <oliva@dcc.unicamp.br> + + * dwarf2.C, dwarf3.C: Added XFAIL for Solaris/x86. Removed + -gdwarf. + * dwarf1.C: Removed -gdwarf. + +1999-08-05 Alexandre Oliva <oliva@dcc.unicamp.br> + + * new1.C, template8.C: Removed XFAIL. + * template3.C: Re-introduced XFAIL. :-( + +1999-08-03 Alexandre Oliva <oliva@dcc.unicamp.br> + + * ext1.C: New test. + + * dwarf1.C, dwarf2.C, dwarf3.C: New tests. + +1999-07-20 Alexandre Oliva <oliva@dcc.unicamp.br> + + * template8.C, typeof1.C: New test. + +1999-07-17 Alexandre Oliva <oliva@dcc.unicamp.br> + + * template6.C, delete1.C, template7.C: New test. + +1999-07-13 Alexandre Oliva <oliva@dcc.unicamp.br> + + * template5.C: New test. + + * template4.C: New test. + + * expr1.C: New test. + + * partspec1.C: New test. + +1999-07-05 Alexandre Oliva <oliva@dcc.unicamp.br> + + * typename1.C, typename2.C: New tests. + + * template3.C: Fixed. + + * ns3.C: New test. + +1999-07-03 Alexandre Oliva <oliva@dcc.unicamp.br> + + * ctor1.C: New test. + + * template3.C: New test. + +1999-07-02 Alexandre Oliva <oliva@dcc.unicamp.br> + + * ns1.C: Typo. + * ns2.C: New test. + + * template2.C: New test. + + * ns1.C: New test. + +1999-07-01 Alexandre Oliva <oliva@dcc.unicamp.br> + + * new1.C: New test. + + * partord1.C: New test. + + * template1.C: New test. + diff --git a/gcc/testsuite/g++.old-deja/g++.oliva/dwarf1.C b/gcc/testsuite/g++.old-deja/g++.oliva/dwarf1.C new file mode 100644 index 00000000000..35ea809a7da --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.oliva/dwarf1.C @@ -0,0 +1,16 @@ +// Build don't link: + +// Copyright (C) 1999 Free Software Foundation + +// by Alexandre Oliva <oliva@dcc.unicamp.br> +// based on bug report by Chris McKay <chris.mckay@solipsys.com> + +// Used to fail with dwarf debugging. +// crash test + +template <class T = void> +struct foo { + static const int ELEMENTS = 1; + int bar[ELEMENTS]; +}; +foo<> bar; diff --git a/gcc/testsuite/g++.old-deja/g++.oliva/dwarf2.C b/gcc/testsuite/g++.old-deja/g++.oliva/dwarf2.C new file mode 100644 index 00000000000..7dc7b94388b --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.oliva/dwarf2.C @@ -0,0 +1,11 @@ +// Build don't link: + +// Copyright (C) 1999 Free Software Foundation + +// by Alexandre Oliva <oliva@dcc.unicamp.br> + +// Fails with dwarf debugging. +// crash test - XFAIL i386-pc-solaris* + +typedef __java_boolean jboolean; +void foo() {} diff --git a/gcc/testsuite/g++.old-deja/g++.oliva/dwarf3.C b/gcc/testsuite/g++.old-deja/g++.oliva/dwarf3.C new file mode 100644 index 00000000000..668ba4b9057 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.oliva/dwarf3.C @@ -0,0 +1,26 @@ +// Build don't link: + +// Copyright (C) 1999 Free Software Foundation + +// by Alexandre Oliva <oliva@dcc.unicamp.br> +// based on bug report by Andreas Stolcke <stolcke@speech.sri.com> + +// Fails with dwarf debugging. +// crash test - XFAIL i386-pc-solaris* + +template <class T = void> struct foo { + int data[1]; +}; + +template <class T = void> struct bar { + bar(foo<> *); +}; + +template <class T> bar<T>::bar(foo<> *x) { + *x; +} + +void baz() { + foo<> *baz; + bar<> baar(baz); +} diff --git a/gcc/testsuite/g++.old-deja/g++.oliva/ext1.C b/gcc/testsuite/g++.old-deja/g++.oliva/ext1.C new file mode 100644 index 00000000000..05abec25b69 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.oliva/ext1.C @@ -0,0 +1,19 @@ +// Copyright (C) 1999 Free Software Foundation + +// by Alexandre Oliva <oliva@dcc.unicamp.br> +// simplified from bug report by Michael Rosenbruch <Rosenbruch@bfw-online.de> + +// Special g++ Options: +// execution test - XFAIL *-*-* + +extern "C" void abort(); + +int main () { + char x[1]; + char *y = x ? /* implicit x */ : 0; + /* For some reason, the array x is copied twice, and y points to the + second copy (the first is never used). If x is explicit, no copy + is created, and the program succeeds. */ + if (x != y) + abort(); +} diff --git a/gcc/testsuite/g++.old-deja/g++.oliva/new1.C b/gcc/testsuite/g++.old-deja/g++.oliva/new1.C new file mode 100644 index 00000000000..67c050b5fd6 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.oliva/new1.C @@ -0,0 +1,18 @@ +// Copyright (C) 1999 Free Software Foundation + +// by Alexandre Oliva <oliva@dcc.unicamp.br> + +// based on comp.std.c++ post by Alexander Schiemann <aschiem@math.uni-sb.de> + +// execution test + +#include <new> + +struct A { + A() { throw 0; } + void* operator new(size_t size, double = 0.0) { return ::operator new(size);} + void operator delete(void* p, double) { exit(0); } + void operator delete(void* p) { abort(); } +}; + +int main() { try { new A; } catch(...) {} } diff --git a/gcc/testsuite/g++.old-deja/g++.oliva/template3.C b/gcc/testsuite/g++.old-deja/g++.oliva/template3.C new file mode 100644 index 00000000000..5071f713fc6 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.oliva/template3.C @@ -0,0 +1,11 @@ +// Build don't link: + +// Copyright (C) 1999 Free Software Foundation + +// by Alexandre Oliva <oliva@dcc.unicamp.br> +// based on bug report by Ulf Larsson <ulf.larsson@mbow337.swipnet.se> + +// crash test - XFAIL *-*-* + +template <class T> class C {}; +class foo {} bar = bar.C(); diff --git a/gcc/testsuite/g++.old-deja/g++.oliva/template8.C b/gcc/testsuite/g++.old-deja/g++.oliva/template8.C new file mode 100644 index 00000000000..4319b220e54 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.oliva/template8.C @@ -0,0 +1,18 @@ +// Build don't link: + +// Copyright (C) 1999 Free Software Foundation + +// by Alexandre Oliva <oliva@dcc.unicamp.br> +// simplified from bug report by redleaf <e1wwater@dingo.cc.uq.edu.au> + +struct B { + template <class> void bar(); +} b; + +template <class T> void foo() { + b.bar<T>(); // no longer gets bogus error - bar undeclared + b.template bar<T>(); // no longer gets bogus error - ditto + b.B::bar<T>(); // ok +} + +template void foo<void>(); // no longer gets bogus error diff --git a/gcc/testsuite/g++.old-deja/g++.oliva/thunk1.C b/gcc/testsuite/g++.old-deja/g++.oliva/thunk1.C new file mode 100644 index 00000000000..5407e9e0583 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.oliva/thunk1.C @@ -0,0 +1,38 @@ +// Copyright (C) 1999 Free Software Foundation + +// by Alexandre Oliva <oliva@dcc.unicamp.br> +// based on bug report by Fredrik Öhrström <d92-foh@nada.kth.se> + +// Special g++ Options: -fvtable-thunks +// execution test - XFAIL *-*-* + +#include <cstdlib> + +using namespace std; + +struct vbase { + virtual int get_a() const = 0; +}; + +struct base: virtual vbase { + int a; + base(int aa) : a(aa) {} + int get_a() const { return a; } +}; + +struct mid: base { + mid(int bb) : base(bb) { + // when mid is not in charge of vbase initialization, + // a derived-aware vtable is needed for vbase + if (((vbase*)this)->get_a() != bb) + abort(); + } +}; + +struct derived: virtual mid { + derived(int cc) : mid(cc) {} +}; + +int main () { + derived(1); +} diff --git a/gcc/testsuite/g++.old-deja/g++.other/decl5.C b/gcc/testsuite/g++.old-deja/g++.other/decl5.C new file mode 100644 index 00000000000..528574cb66c --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/decl5.C @@ -0,0 +1,78 @@ +// Build don't link: + +// Copyright (C) 1999 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 22 Apr 1999 <nathan@acm.org> +// derived from a bug report by <rch@larissa.sd.bi.ruhr-uni-bochum.de> +// http://egcs.cygnus.com/ml/egcs-bugs/1999-04/msg00626.html +// the code is wrong, but we fell over badly + + +struct A { + int A::fn(); // WARNING - extra qualification + int A::m; // WARNING - extra qualification + struct e; + struct A::e {int i;}; + struct A::expand { // WARNING - extra qualification + int m; + }; + struct Z; + expand me; + void foo(struct A::e); + void foo(struct A::z); // WARNING - extra qualification +}; + +struct Q; +struct B { + struct A::fink { // ERROR - no such member + int m; + }; + struct A::Z { // ERROR XFAIL - A::Z not a member of B + int m; + }; + int m; + int n; + struct ::Q { // ERROR XFAIL - ::Q not a member of B + int m; + }; + int A::fn() { // ERROR - A::fn not a member of B + return 0; + } + void fn(struct ::Q &); + void foo(struct A::y); // ERROR - no such member +}; + +struct ::C { // WARNING - extra qualification + int i; +}; + +namespace N { + int fn(); + struct F; +} + +namespace NMS +{ + void NMS::fn(); // WARNING - extra qualification XFAIL + int NMS::i; // WARNING - extra qualification XFAIL + struct NMS::D { // WARNING - extra qualification + int i; + }; + struct N::E { // ERROR - no such type + int i; + }; + struct ::F { // ERROR - no such type + int i; + }; + int N::fn() { // ERROR - N::fn not a member of NMS + return 0; + } + struct N::F { // ERROR XFAIL - N::F not a member of NMS + int i; + }; +} + +NMS::D thing; +void NMS::fn() +{ + i = 3; +} diff --git a/gcc/testsuite/g++.old-deja/g++.other/defarg3.C b/gcc/testsuite/g++.old-deja/g++.other/defarg3.C new file mode 100644 index 00000000000..84792c8c4c1 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/defarg3.C @@ -0,0 +1,9 @@ +// Build don't link: +// Origin: Mark Mitchell <mark@codesourcery.com> + +int* hp; +int* jp; + +void f (int *ip, int kp = hp - jp) +{ +} diff --git a/gcc/testsuite/g++.old-deja/g++.other/enum2.C b/gcc/testsuite/g++.old-deja/g++.other/enum2.C new file mode 100644 index 00000000000..c1a9ae20a88 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/enum2.C @@ -0,0 +1,16 @@ +// Build don't link: + +// Copyright (C) 1999 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 3 Jun 1999 <nathan@acm.org> + +// We'd like the enum location to be its open brace. + +enum thing +{ // ERROR - previous def + val1 +}; + +enum thing +{ // ERROR - multiple def + val2 +}; diff --git a/gcc/testsuite/g++.old-deja/g++.other/ptrmem5.C b/gcc/testsuite/g++.old-deja/g++.other/ptrmem5.C new file mode 100644 index 00000000000..7c38857e67c --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/ptrmem5.C @@ -0,0 +1,17 @@ +// Bug: g++ doesn't see that A is a vbase of C. +// Submitted by Jason Merrill <jason@cygnus.com> +// Build don't link: + +struct A { + int i; + void f (); +}; + +struct B: public A { }; +struct C: public virtual B { }; + +void g () +{ + int C::*p = &A::i; // ERROR - conversion from vbase + void (C::*fp)() = &A::f; // ERROR - conversion from vbase +} diff --git a/gcc/testsuite/g++.old-deja/g++.other/shadow1.C b/gcc/testsuite/g++.old-deja/g++.other/shadow1.C new file mode 100644 index 00000000000..1691ed430e1 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/shadow1.C @@ -0,0 +1,12 @@ +// Bug: g++ thinks that the i in g() shadows the parm from f() +// Contributed by Jason Merrill <jason@cygnus.com> +// Build don't link: + +void f (int i) +{ + struct A { + void g () { + int i; + } + }; +} diff --git a/gcc/testsuite/g++.old-deja/g++.other/struct1.C b/gcc/testsuite/g++.old-deja/g++.other/struct1.C new file mode 100644 index 00000000000..4f1c52ab092 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/struct1.C @@ -0,0 +1,42 @@ +// Build don't link: + +// Copyright (C) 1999 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 3 Jun 1999 <nathan@acm.org> + +// Duplicate definitions are wrong, we should just cough +// politely, but we used to die horribly. + +class Y +{ // ERROR - previous definition +}; +class Y +{ // ERROR - redefinition +}; + +template<class T> class X +{ // ERROR - previous definition +}; +template<class T> class X +{ // ERROR - redefinition +}; + +template<class T> class X<T *> +{ // ERROR - previous definition +}; +template<class T> class X<T *> +{ // ERROR - redefinition +}; + +template<> class X<int> +{ // ERROR - previous definition +}; +template<> class X<int> +{ // ERROR - redefinition +}; + +template<> class X<int *> +{ // ERROR - previous definition +}; +template<> class X<int *> +{ // ERROR - redefinition +}; diff --git a/gcc/testsuite/g++.old-deja/g++.other/virtual6.C b/gcc/testsuite/g++.old-deja/g++.other/virtual6.C new file mode 100644 index 00000000000..d0769fc6ae7 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/virtual6.C @@ -0,0 +1,14 @@ +// Bug: g++ checks certain non-virtual functions to see if they override +// virtual functions. +// Submitted by Jason Merrill <jason@cygnus.com> +// Special g++ Options: -Woverloaded-virtual +// Build don't link: + +struct A { + virtual void f (int); +}; + +struct B: public A { + static void f (); + void f (int); +}; diff --git a/gcc/testsuite/g++.old-deja/g++.pt/crash45.C b/gcc/testsuite/g++.old-deja/g++.pt/crash45.C new file mode 100644 index 00000000000..6201a5cc577 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/crash45.C @@ -0,0 +1,13 @@ +// Build don't link: +// Origin: Jason Merrill <jason@cygnus.com> + +template <class T> void f() +{ + extern void g (); +} + +int main() +{ + f<int>(); +} + diff --git a/gcc/testsuite/g++.old-deja/g++.pt/crash46.C b/gcc/testsuite/g++.old-deja/g++.pt/crash46.C new file mode 100644 index 00000000000..e226559429d --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/crash46.C @@ -0,0 +1,8 @@ +// Build don't link: +// Origin: Leon Bottou <leonb@research.att.com> + +class AA { protected: + template <class T> struct BB { T x; BB(const T &x) : x(x) { }; }; + template <class T> struct CC : public BB<T> { CC(const T &x) : BB<T>(x) { }; +}; +}; diff --git a/gcc/testsuite/g++.old-deja/g++.pt/crash47.C b/gcc/testsuite/g++.old-deja/g++.pt/crash47.C new file mode 100644 index 00000000000..96a23fd5c27 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/crash47.C @@ -0,0 +1,17 @@ +// Build don't link: +// Origin: Rick Campbell <rick.campbell@db.com> + +template <class Owner, typename Type> +struct DataMember +{ + inline DataMember (Type Owner::* data_member); + + Type Owner::* _data_member; +}; + +template <class Owner, typename Type> +inline +DataMember<Owner,Type>::DataMember (Type Owner::* data_member) + : _data_member (data_member) +{ +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/crash48.C b/gcc/testsuite/g++.old-deja/g++.pt/crash48.C new file mode 100644 index 00000000000..907360bf78e --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/crash48.C @@ -0,0 +1,8 @@ +// Build don't link: +// Origin: Jean-Francois Panisset <panisset@discreet.com> + +template<class T> +void foo(T *data) +{ + ((char *)data)->~T(); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/crash49.C b/gcc/testsuite/g++.old-deja/g++.pt/crash49.C new file mode 100644 index 00000000000..b9f7801e9ff --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/crash49.C @@ -0,0 +1,37 @@ +// Build don't link: +// Origin: Loring Holden <lsh@cs.brown.edu> + +template <class T> +class REFptr { + public: + virtual ~REFptr(); + REFptr<T> &operator = (const REFptr<T>& p); +}; + +class STR { }; +class str_ptr : public REFptr<STR> { }; + +template <class T> +class ARRAY { + protected: + T *_array; + int _num; + int _max; + public: + virtual void realloc(int new_max) { + _max = new_max; + T *tmp = new T [_max]; + if (tmp == 0) return; + for (int i=0; i<_num; i++) { + tmp[i] = _array[i]; + } + delete [] _array; + _array = tmp; + } +}; + +int +main() +{ + ARRAY<str_ptr> tags; +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/crash50.C b/gcc/testsuite/g++.old-deja/g++.pt/crash50.C new file mode 100644 index 00000000000..6415fc3032a --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/crash50.C @@ -0,0 +1,10 @@ +// Build don't link: +// Origin: Mark Mitchell <mark@codesourcery.com> + +template <class T> +void f () +{ + __extension__ ( { if (3); }); +} + +template void f<int>(); diff --git a/gcc/testsuite/g++.old-deja/g++.pt/decl3.C b/gcc/testsuite/g++.old-deja/g++.pt/decl3.C new file mode 100644 index 00000000000..bdc25011abf --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/decl3.C @@ -0,0 +1,5 @@ +// Build don't link: +// Origin: Jason Merrill <jason@cygnus.com> + +template <class T, class U = int> struct A; +template <class T = int, class U> struct A { }; diff --git a/gcc/testsuite/g++.old-deja/g++.pt/defarg12.C b/gcc/testsuite/g++.old-deja/g++.pt/defarg12.C new file mode 100644 index 00000000000..3c53e8e1fb6 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/defarg12.C @@ -0,0 +1,12 @@ +// Build don't link: +// Origin: Mark Mitchell <mark@codesourcery.com> + +template <class T = int> +struct S +{ + void f () + { + struct U { + }; + } +}; diff --git a/gcc/testsuite/g++.old-deja/g++.pt/defarg13.C b/gcc/testsuite/g++.old-deja/g++.pt/defarg13.C new file mode 100644 index 00000000000..1082bf567e0 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/defarg13.C @@ -0,0 +1,13 @@ +// Build don't link: +// Origin: Mark Mitchell <mark@codesourcery.com> + +template <class T> +void f (int i) +{ + struct S { void g (int j = i) {} }; // ERROR - default argument uses local + + S s; // ERROR - instantiated here +} + +template void f<double>(int); // ERROR - instantiated here + diff --git a/gcc/testsuite/g++.old-deja/g++.pt/ehspec1.C b/gcc/testsuite/g++.old-deja/g++.pt/ehspec1.C new file mode 100644 index 00000000000..ad1f6c53676 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/ehspec1.C @@ -0,0 +1,6 @@ +// Bug: g++ forgets to instantiate A<int> +// Contributed by Jason Merrill <jason@cygnus.com> +// Build don't link: + +template <class T> struct A { }; +void f () throw (A<int>); diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp84.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp84.C new file mode 100644 index 00000000000..15246c58d9b --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp84.C @@ -0,0 +1,18 @@ +// Build don't link: + +// Copyright (C) 1999 Free Software Foundation + +// by Alexandre Oliva <oliva@dcc.unicamp.br> +// simplified from bug report by redleaf <e1wwater@dingo.cc.uq.edu.au> + +struct B { + template <class> void bar(); +} b; + +template <class T> void foo() { + b.bar<T>(); // gets bogus error - bar undeclared + b.template bar<T>(); // gets bogus error - ditto + b.B::bar<T>(); +} + +template void foo<void>(); // gets bogus error diff --git a/gcc/testsuite/g++.old-deja/g++.pt/ptrmem8.C b/gcc/testsuite/g++.old-deja/g++.pt/ptrmem8.C new file mode 100644 index 00000000000..f6125cdeaf6 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/ptrmem8.C @@ -0,0 +1,18 @@ +// Build don't link: +// Origin: Mark Mitchell <mark@codesourcery.com> + +template <class T> +struct S +{ + void f (const T&); + void f (T&); +}; + +class C +{ +}; + +typedef int (C::*cp)(); + +template struct S<cp>; + diff --git a/gcc/testsuite/g++.old-deja/g++.pt/ptrmem9.C b/gcc/testsuite/g++.old-deja/g++.pt/ptrmem9.C new file mode 100644 index 00000000000..9963a15ab6f --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/ptrmem9.C @@ -0,0 +1,6 @@ +// Build don't link: +// Origin: Jason Merrill <jason@cygnus.com> + +struct A; +template <class T> void f (void (A::* const)(T)) {} +void (*p)(void (A::* const)(int)) = f; diff --git a/gcc/testsuite/g++.old-deja/g++.pt/repo1.C b/gcc/testsuite/g++.old-deja/g++.pt/repo1.C new file mode 100644 index 00000000000..f57b2c22fd0 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/repo1.C @@ -0,0 +1,18 @@ +// Bug: g++ complains about duplicate explicit instantiations with -frepo. +// From Jason Merrill <jason@cygnus.com> + +// Build then link: +// Special g++ Options: -frepo + +template <class T> struct A { + virtual ~A () { } +}; + +template <class T> void g (T t) { } + +template class A<int>; + +int main () +{ + g (42); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/typename23.C b/gcc/testsuite/g++.old-deja/g++.pt/typename23.C new file mode 100644 index 00000000000..5bdbe6fd61c --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/typename23.C @@ -0,0 +1,15 @@ +// Build don't link: +template<class T> +void value_type(T){} + +template <class T> +struct B{ + typedef T value_type; +}; + +template<class>class Vector{}; + +template<class T> +struct D:B<T>{ + Vector<value_type> r; // ERROR - value_type is not a type +}; diff --git a/gcc/testsuite/g++.old-deja/g++.pt/var1.C b/gcc/testsuite/g++.old-deja/g++.pt/var1.C new file mode 100644 index 00000000000..06cbfa9db86 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/var1.C @@ -0,0 +1,4 @@ +// Build don't link: +// Origin: Jason Merrill <jason@cygnus.com> + +template <class T> T t; // ERROR - template declaration of t diff --git a/gcc/testsuite/gcc.c-torture/execute/990804-1.c b/gcc/testsuite/gcc.c-torture/execute/990804-1.c new file mode 100644 index 00000000000..130c0fb5e51 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/990804-1.c @@ -0,0 +1,30 @@ +int gfbyte ( void ) +{ + return 0; +} + +int main( void ) +{ + int i,j,k ; + + i = gfbyte(); + + i = i + 1 ; + + if ( i == 0 ) + k = -0 ; + else + k = i + 0 ; + + if (i != 1) + abort (); + + k = 1 ; + if ( k <= i) + do + j = gfbyte () ; + while ( k++ < i ) ; + + exit (0); +} + diff --git a/gcc/testsuite/gcc.c-torture/execute/990811-1.c b/gcc/testsuite/gcc.c-torture/execute/990811-1.c new file mode 100644 index 00000000000..95e1da9cdfa --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/990811-1.c @@ -0,0 +1,31 @@ +struct s {long a; int b;}; + +int foo(int x, void *y) +{ + switch(x) { + case 0: return ((struct s*)y)->a; + case 1: return *(signed char*)y; + case 2: return *(short*)y; + } + abort(); +} + +int main () +{ + struct s s; + short sh[10]; + signed char c[10]; + int i; + + s.a = 1; + s.b = 2; + for (i = 0; i < 10; i++) { + sh[i] = i; + c[i] = i; + } + + if (foo(0, &s) != 1) abort(); + if (foo(1, c+3) != 3) abort(); + if (foo(2, sh+3) != 3) abort(); + exit(0); +} |