aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <rth@cygnus.com>2000-04-30 10:22:18 +0000
committerRichard Henderson <rth@cygnus.com>2000-04-30 10:22:18 +0000
commit0657515daa1366d8a80e5de42179efc2c5731465 (patch)
tree0ab0eb6846a0ce5e0bdaebfb0c3ecb56cb4b3cf4
parentb8e8aec853a1b8272c7403ab15d42a96997dddf6 (diff)
Merge from mainlinecondexec-branch
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/condexec-branch@33542 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--contrib/ChangeLog8
-rwxr-xr-xcontrib/index-prop4
-rw-r--r--gcc/ChangeLog76
-rw-r--r--gcc/calls.c25
-rw-r--r--gcc/config/alpha/crtbegin.asm140
-rw-r--r--gcc/config/alpha/crtend.asm106
-rw-r--r--gcc/config/alpha/elf.h3
-rw-r--r--gcc/config/h8300/h8300.c2
-rw-r--r--gcc/config/mn10300/mn10300.h75
-rwxr-xr-xgcc/configure8
-rw-r--r--gcc/configure.in8
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/decl.c29
-rw-r--r--gcc/cp/optimize.c4
-rw-r--r--gcc/cpphash.c342
-rw-r--r--gcc/cpphash.h88
-rw-r--r--gcc/cpplib.c5
-rw-r--r--gcc/f/version.c2
-rw-r--r--gcc/gcc.texi34
-rw-r--r--gcc/java/parse.c10
-rw-r--r--gcc/jump.c2
-rw-r--r--gcc/pcp.h101
-rw-r--r--gcc/po/ChangeLog4
-rw-r--r--gcc/po/POTFILES.in1
-rw-r--r--gcc/regmove.c76
-rw-r--r--gcc/version.c2
-rw-r--r--include/ChangeLog7
-rw-r--r--include/demangle.h15
-rw-r--r--libf2c/libF77/Version.c2
-rw-r--r--libf2c/libI77/Version.c2
-rw-r--r--libf2c/libU77/Version.c2
-rw-r--r--libiberty/ChangeLog12
-rw-r--r--libiberty/Makefile.in6
-rw-r--r--libiberty/cplus-dem.c150
34 files changed, 786 insertions, 570 deletions
diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index a1ebf0a5b1f..7ad347abfc7 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,11 @@
+2000-04-28 Jason Merrill <jason@casey.cygnus.com>
+
+ * index-prop: Use a single pattern. Also support *** cdiffs.
+
+2000-04-28 Pavel Roskin <pavel_roskin@geocities.com>
+
+ * index-prop: Don't change /dev/null.
+
2000-04-27 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
* gcc_update: Refer to GCC and gcc_update instead of egcs and
diff --git a/contrib/index-prop b/contrib/index-prop
index 285ad8c5890..1ea648989f6 100755
--- a/contrib/index-prop
+++ b/contrib/index-prop
@@ -14,8 +14,8 @@ while (<>)
for (1..7)
{
$_ = <>;
- s/^--- [^\t]+\t/--- $full\t/;
- s/^\+\+\+ [^\t]+\t/\+\+\+ $full\t/;
+ s/^([-+*]{3}) [^\t]+\t/$1 $full\t/
+ unless m{ /dev/null\t};
print;
}
}
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0db19858e21..f2d0d500a80 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,79 @@
+2000-04-29 Richard Henderson <rth@cygnus.com>
+
+ * config/alpha/crtend.asm: Use C comments instead of #.
+ * config/alpha/crtbegin.asm: Likewise. Mark __dso_handle hidden.
+
+ * config/alpha/elf.h (SELECT_SECTION): Treat CONSTRUCTOR like VAR_DECL.
+
+2000-04-29 Zack Weinberg <zack@wolery.cumb.org>
+
+ * cpphash.h (enum node_type: Take out T_MCONST.
+ (union hashval): Move into struct hashnode.
+ (struct hashnode): Pack tighter. Remove file, line, col
+ members.
+ * cpphash.c: Constify most of the macro-definition structures.
+ (struct definition): Replace by struct object_defn
+ and struct funct_defn. Put file, line, column information
+ here. All users updated to match.
+ (_cpp_create_definition, _cpp_macroexpand): Remove special
+ case for #define WORD OTHERWORD.
+ * cpplib.c (do_undef): Remove T_MCONST case.
+
+ * cpphash.h: Move struct reflist, struct definition, and the
+ DEFINITION typedef to cpphash.c. Use 'struct definition *' in
+ union hashval. _cpp_free_definition takes a HASHNODE pointer.
+ * cpphash.c (_cpp_free_definition): Free data pointed to by
+ MCONST, XCONST, MACRO, and FMACRO nodes properly.
+ (_cpp_create_definition, del_HASHNODE): Just call
+ _cpp_free_definition to clear out a hashnode.
+ * cpplib.c (do_pragma_poison): Likewise.
+
+Sat Apr 29 12:25:17 2000 Alexandre Oliva <aoliva@cygnus.com>
+
+ * config/mn10300/mn10300.h (FIRST_DATA_REGNUM,
+ LAST_DATA_REGNUM, FIRST_ADDRESS_REGNUM, LAST_ADDRESS_REGNUM,
+ FIRST_EXTENDED_REGNUM, LAST_EXTENDED_REGNUM): New macros.
+ (REGNO_SP_P): Redefine in terms of STACK_POINTER_REGNUM.
+ (REGNO_DATA_P, REGNO_ADDRESS_P, REGNO_EXTENDED_P,
+ REGNO_AM33_P): Redefine in terms of the new macros.
+ (CONDITIONAL_REGISTER_USAGE, REGNO_REG_CLASS): Likewise.
+ (FUNCTION_VALUE, LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P,
+ STRUCT_VALUE): Likewise.
+ (STACK_POINTER_REGNUM, FRAME_POINTER_REGNUM,
+ ARG_POINTER_REGNUM, STATIC_CHAIN_REGNUM): Likewise. Moved.
+
+Sat Apr 29 01:18:45 MET DST 2000 Jan Hubicka <jh@suse.cz>
+
+ * regmove.c (struct record_stack_memrefs_data): New.
+ (record_stack_memrefs): New function.
+ (combine_stack_adjustments_for_block): Use it.
+
+Sat Apr 29 01:15:27 MET DST 2000 Jan Hubicka <jh@suse.cz>
+
+ * calls.c (calls_function_1): Propertly handle TREE_LIST expressions;
+ use special_function_p to detect alloca.
+
+Fri Apr 28 16:30:33 2000 Marc Espie <espie@cvs.openbsd.org>
+
+ * gcc.texi: Fixes for makeinfo 4.0 --html.
+
+2000-04-28 Zack Weinberg <zack@wolery.cumb.org>
+
+ * pcp.h: Delete file.
+
+2000-04-28 Kazu Hirata <kazu@hxi.com>
+
+ * h8300.c (function_epilogue): Clean up flags when the last insn
+ in a function is a barrier.
+
+2000-04-28 Chris Demetriou <cgd@sibyte.com>
+
+ * configure.in (sparc-hal-solaris2*): protect [] glob from
+ my expansion.
+ (mips*-*-ecoff*, mips*-*-elf*, mips*-*-*): use MASK_ defines
+ rather than hard-coded constants in target_cpu_default2.
+ * configure: Regenerate.
+
2000-04-28 Jason Merrill <jason@casey.cygnus.com>
* tree.c (get_callee_fndecl): Extract the initial value from
diff --git a/gcc/calls.c b/gcc/calls.c
index eff0042422f..78e3f102e05 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -254,11 +254,6 @@ calls_function_1 (exp, which)
if ((int) code >= NUM_TREE_CODES)
return 1;
- /* Only expressions and references can contain calls. */
- if (type != 'e' && type != '<' && type != '1' && type != '2' && type != 'r'
- && type != 'b')
- return 0;
-
switch (code)
{
case CALL_EXPR:
@@ -269,12 +264,8 @@ calls_function_1 (exp, which)
== FUNCTION_DECL))
{
tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0);
-
- if ((DECL_BUILT_IN (fndecl)
- && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL
- && DECL_FUNCTION_CODE (fndecl) == BUILT_IN_ALLOCA)
- || (DECL_SAVED_INSNS (fndecl)
- && DECL_SAVED_INSNS (fndecl)->calls_alloca))
+ int flags = special_function_p (fndecl, 0);
+ if (flags & ECF_MAY_BE_ALLOCA)
return 1;
}
@@ -311,6 +302,11 @@ calls_function_1 (exp, which)
return 1;
}
return 0;
+ case TREE_LIST:
+ for (; exp != 0; exp = TREE_CHAIN (exp))
+ if (calls_function_1 (TREE_VALUE (exp), which))
+ return 1;
+ return 0;
case METHOD_CALL_EXPR:
length = 3;
@@ -322,11 +318,16 @@ calls_function_1 (exp, which)
case RTL_EXPR:
return 0;
-
+
default:
break;
}
+ /* Only expressions and references can contain calls. */
+ if (type != 'e' && type != '<' && type != '1' && type != '2' && type != 'r'
+ && type != 'b')
+ return 0;
+
for (i = 0; i < length; i++)
if (TREE_OPERAND (exp, i) != 0
&& calls_function_1 (TREE_OPERAND (exp, i), which))
diff --git a/gcc/config/alpha/crtbegin.asm b/gcc/config/alpha/crtbegin.asm
index 4cc868d8a99..cbeba99a281 100644
--- a/gcc/config/alpha/crtbegin.asm
+++ b/gcc/config/alpha/crtbegin.asm
@@ -1,42 +1,47 @@
- # Copyright (C) 1996, 1998 Free Software Foundation, Inc.
- # Contributed by Richard Henderson (rth@tamu.edu)
- #
- # This file 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.
- #
- # In addition to the permissions in the GNU General Public License, the
- # Free Software Foundation gives you unlimited permission to link the
- # compiled version of this file with other programs, and to distribute
- # those programs without any restriction coming from the use of this
- # file. (The General Public License restrictions do apply in other
- # respects; for example, they cover modification of the file, and
- # distribution when not linked into another program.)
- #
- # This file 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.
- #
- # As a special exception, if you link this library with files
- # compiled with GCC to produce an executable, this does not cause
- # the resulting executable to be covered by the GNU General Public License.
- # This exception does not however invalidate any other reasons why
- # the executable file might be covered by the GNU General Public License.
-
- #
- # Heads of the constructor/destructor lists.
- #
-
- # The __*TOR_LIST__ symbols are not global because when this file is used
- # in a shared library, we do not want the symbol to fall over to the
- # application's lists.
+/*
+ * Copyright (C) 1996, 1998, 2000 Free Software Foundation, Inc.
+ * Contributed by Richard Henderson (rth@tamu.edu)
+ *
+ * This file 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.
+ *
+ * In addition to the permissions in the GNU General Public License, the
+ * Free Software Foundation gives you unlimited permission to link the
+ * compiled version of this file with other programs, and to distribute
+ * those programs without any restriction coming from the use of this
+ * file. (The General Public License restrictions do apply in other
+ * respects; for example, they cover modification of the file, and
+ * distribution when not linked into another program.)
+ *
+ * This file 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.
+ *
+ * As a special exception, if you link this library with files
+ * compiled with GCC to produce an executable, this does not cause
+ * the resulting executable to be covered by the GNU General Public License.
+ * This exception does not however invalidate any other reasons why
+ * the executable file might be covered by the GNU General Public License.
+ */
+
+#include "auto-host.h"
+
+
+/*
+ * Heads of the constructor/destructor lists.
+ */
+
+/* The __*TOR_LIST__ symbols are not global because when this file is used
+ in a shared library, we do not want the symbol to fall over to the
+ application's lists. */
.section .ctors,"aw"
@@ -53,29 +58,29 @@ __DTOR_LIST__:
.section .eh_frame,"aw"
__EH_FRAME_BEGIN__:
- #
- # Fragment of the ELF _fini routine that invokes our dtor cleanup.
- #
+/*
+ * Fragment of the ELF _fini routine that invokes our dtor cleanup.
+ */
.section .fini,"ax"
- # Since the bits of the _fini function are spread across many
- # object files, each potentially with its own GP, we must
- # assume we need to load ours. Further, our .fini section
- # can easily be more than 4MB away from our .text bits so we
- # can't use bsr.
+ /* Since the bits of the _fini function are spread across many
+ object files, each potentially with its own GP, we must
+ assume we need to load ours. Further, our .fini section
+ can easily be more than 4MB away from our .text bits so we
+ can't use bsr. */
br $29,1f
1: ldgp $29,0($29)
jsr $26,__do_global_dtors_aux
- # Must match the alignment we got from crti.o else we get
- # zero-filled holes in our _fini function and then SIGILL.
+ /* Must match the alignment we got from crti.o else we get
+ zero-filled holes in our _fini function and then SIGILL. */
.align 3
- #
- # Fragment of the ELF _init routine that sets up the frame info.
- #
+/*
+ * Fragment of the ELF _init routine that sets up the frame info.
+ */
.section .init,"ax"
br $29,1f
@@ -83,19 +88,25 @@ __EH_FRAME_BEGIN__:
jsr $26,__do_frame_setup
.align 3
- #
- # Invoke our destructors in order.
- #
+/*
+ * Invoke our destructors in order.
+ */
.section .sdata
- # Support recursive calls to exit.
+/* Support recursive calls to exit. */
.type dtor_ptr,@object
.size dtor_ptr,8
dtor_ptr:
.quad __DTOR_LIST__ + 8
- # A globally unique widget for c++ local destructors to hang off.
+/* A globally unique widget for c++ local destructors to hang off.
+
+ This has a unique value in every dso; in the main program its
+ value is zero. The object should be protected. This means the
+ instance in any dso or the main program is not used in any other
+ dso. The dynamic linker takes care of this. */
+
.global __dso_handle
.type __dso_handle,@object
.size __dso_handle,8
@@ -110,6 +121,9 @@ __dso_handle:
__dso_handle:
.zero 8
#endif
+#ifdef HAVE_GAS_HIDDEN
+ .hidden __dso_handle
+#endif
.text
@@ -126,7 +140,7 @@ __do_global_dtors_aux:
.prologue 1
#ifdef SHARED
- # Do c++ local destructors.
+ /* Do c++ local destructors. */
lda $1,__cxa_finalize
beq $1,0f
lda $16,__dso_handle
@@ -144,7 +158,7 @@ __do_global_dtors_aux:
addq $1,8,$1
bne $27,1b
- # Remove our frame info.
+ /* Remove our frame info. */
lda $1,__deregister_frame_info
beq $1,3f
lda $16,__EH_FRAME_BEGIN__
@@ -158,11 +172,11 @@ __do_global_dtors_aux:
.end __do_global_dtors_aux
- #
- # Install our frame info.
- #
+/*
+ * Install our frame info.
+ */
- # ??? How can we rationally keep this size correct?
+/* ??? How can we rationally keep this size correct? */
.section .bss
.type frame_object,@object
diff --git a/gcc/config/alpha/crtend.asm b/gcc/config/alpha/crtend.asm
index d6eb4066ac0..662eb22de9c 100644
--- a/gcc/config/alpha/crtend.asm
+++ b/gcc/config/alpha/crtend.asm
@@ -1,42 +1,44 @@
- # Copyright (C) 1996 Free Software Foundation, Inc.
- # Contributed by Richard Henderson (rth@tamu.edu)
- #
- # This file 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.
- #
- # In addition to the permissions in the GNU General Public License, the
- # Free Software Foundation gives you unlimited permission to link the
- # compiled version of this file with other programs, and to distribute
- # those programs without any restriction coming from the use of this
- # file. (The General Public License restrictions do apply in other
- # respects; for example, they cover modification of the file, and
- # distribution when not linked into another program.)
- #
- # This file 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.
- #
- # As a special exception, if you link this library with files
- # compiled with GCC to produce an executable, this does not cause
- # the resulting executable to be covered by the GNU General Public License.
- # This exception does not however invalidate any other reasons why
- # the executable file might be covered by the GNU General Public License.
-
- #
- # Tails of the constructor/destructor lists.
- #
-
- # The __*TOR_END__ symbols are not global because when this file is used
- # in a shared library, we do not want the symbol to fall over to the
- # application's lists.
+/*
+ * Copyright (C) 1996, 2000 Free Software Foundation, Inc.
+ * Contributed by Richard Henderson (rth@tamu.edu)
+ *
+ * This file 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.
+ *
+ * In addition to the permissions in the GNU General Public License, the
+ * Free Software Foundation gives you unlimited permission to link the
+ * compiled version of this file with other programs, and to distribute
+ * those programs without any restriction coming from the use of this
+ * file. (The General Public License restrictions do apply in other
+ * respects; for example, they cover modification of the file, and
+ * distribution when not linked into another program.)
+ *
+ * This file 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.
+ *
+ * As a special exception, if you link this library with files
+ * compiled with GCC to produce an executable, this does not cause
+ * the resulting executable to be covered by the GNU General Public License.
+ * This exception does not however invalidate any other reasons why
+ * the executable file might be covered by the GNU General Public License.
+ */
+
+/*
+ * Tails of the constructor/destructor lists.
+ */
+
+/* The __*TOR_END__ symbols are not global because when this file is used
+ in a shared library, we do not want the symbol to fall over to the
+ application's lists. */
.section .ctors,"aw"
@@ -54,29 +56,29 @@ __DTOR_END__:
__FRAME_END__:
.quad 0
- #
- # Fragment of the ELF _init routine that invokes our ctor startup
- #
+/*
+ * Fragment of the ELF _init routine that invokes our ctor startup
+ */
.section .init,"ax"
- # Since the bits of the _init function are spread across many
- # object files, each potentially with its own GP, we must
- # assume we need to load ours. Further, our .init section
- # can easily be more than 4MB away from our .text bits so we
- # can't use bsr.
+ /* Since the bits of the _init function are spread across many
+ object files, each potentially with its own GP, we must
+ assume we need to load ours. Further, our .init section
+ can easily be more than 4MB away from our .text bits so we
+ can't use bsr. */
br $29,1f
1: ldgp $29,0($29)
jsr $26,__do_global_ctors_aux
- # Must match the alignment we got from crti.o else we get
- # zero-filled holes in our _init function and thense SIGILL.
+ /* Must match the alignment we got from crti.o else we get
+ zero-filled holes in our _init function and thense SIGILL. */
.align 3
- #
- # Invoke our destructors in order.
- #
+/*
+ * Invoke our constructors in order.
+ */
.text
diff --git a/gcc/config/alpha/elf.h b/gcc/config/alpha/elf.h
index 227c386278d..f67deca5c27 100644
--- a/gcc/config/alpha/elf.h
+++ b/gcc/config/alpha/elf.h
@@ -338,7 +338,8 @@ void FN () \
else \
data_section (); \
} \
- else if (TREE_CODE (DECL) == VAR_DECL) \
+ else if (TREE_CODE (DECL) == VAR_DECL \
+ || TREE_CODE (DECL) == CONSTRUCTOR) \
{ \
if ((flag_pic && RELOC) \
|| !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \
diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c
index 15562d23e64..87b7f19a0c4 100644
--- a/gcc/config/h8300/h8300.c
+++ b/gcc/config/h8300/h8300.c
@@ -402,7 +402,7 @@ function_epilogue (file, size)
if (GET_CODE (insn) == NOTE)
insn = prev_nonnote_insn (insn);
if (insn && GET_CODE (insn) == BARRIER)
- return;
+ goto out;
/* Pop the saved registers. */
for (idx = 0; idx < FIRST_PSEUDO_REGISTER; idx++)
diff --git a/gcc/config/mn10300/mn10300.h b/gcc/config/mn10300/mn10300.h
index f7371550ab9..5bc14520d83 100644
--- a/gcc/config/mn10300/mn10300.h
+++ b/gcc/config/mn10300/mn10300.h
@@ -145,6 +145,31 @@ extern int target_flags;
#define FIRST_PSEUDO_REGISTER 18
+/* Specify machine-specific register numbers. */
+#define FIRST_DATA_REGNUM 0
+#define LAST_DATA_REGNUM 3
+#define FIRST_ADDRESS_REGNUM 4
+#define LAST_ADDRESS_REGNUM 8
+#define FIRST_EXTENDED_REGNUM 10
+#define LAST_EXTENDED_REGNUM 17
+
+/* Specify the registers used for certain standard purposes.
+ The values of these macros are register numbers. */
+
+/* Register to use for pushing function arguments. */
+#define STACK_POINTER_REGNUM (LAST_ADDRESS_REGNUM+1)
+
+/* Base register for access to local variables of the function. */
+#define FRAME_POINTER_REGNUM (LAST_ADDRESS_REGNUM-1)
+
+/* Base register for access to arguments of the function. This
+ is a fake register and will be eliminated into either the frame
+ pointer or stack pointer. */
+#define ARG_POINTER_REGNUM LAST_ADDRESS_REGNUM
+
+/* Register in which static-chain is passed to a function. */
+#define STATIC_CHAIN_REGNUM (FIRST_ADDRESS_REGNUM+1)
+
/* 1 for registers that have pervasive standard uses
and are not available for the register allocator. */
@@ -169,7 +194,8 @@ extern int target_flags;
{ \
if (!TARGET_AM33) \
{ \
- for (i = 10; i < 18; i++) \
+ for (i = FIRST_EXTENDED_REGNUM; \
+ i <= LAST_EXTENDED_REGNUM; i++) \
fixed_regs[i] = call_used_regs[i] = 1; \
} \
}
@@ -272,10 +298,10 @@ enum reg_class {
or could index an array. */
#define REGNO_REG_CLASS(REGNO) \
- ((REGNO) < 4 ? DATA_REGS : \
- (REGNO) < 9 ? ADDRESS_REGS : \
- (REGNO) == 9 ? SP_REGS : \
- (REGNO) < 18 ? EXTENDED_REGS : \
+ ((REGNO) <= LAST_DATA_REGNUM ? DATA_REGS : \
+ (REGNO) <= LAST_ADDRESS_REGNUM ? ADDRESS_REGS : \
+ (REGNO) == STACK_POINTER_REGNUM ? SP_REGS : \
+ (REGNO) <= LAST_EXTENDED_REGNUM ? EXTENDED_REGS : \
NO_REGS)
/* The class value for index registers, and the one for base regs. */
@@ -323,10 +349,14 @@ enum reg_class {
&& reg_renumber[(regno)] >= (min) && reg_renumber[(regno)] <= (max)))
#endif
-#define REGNO_DATA_P(regno) REGNO_IN_RANGE_P ((regno), 0, 3)
-#define REGNO_ADDRESS_P(regno) REGNO_IN_RANGE_P ((regno), 4, 8)
-#define REGNO_SP_P(regno) REGNO_IN_RANGE_P ((regno), 9, 9)
-#define REGNO_EXTENDED_P(regno) REGNO_IN_RANGE_P ((regno), 10, 17)
+#define REGNO_DATA_P(regno) \
+ REGNO_IN_RANGE_P ((regno), FIRST_DATA_REGNUM, LAST_DATA_REGNUM)
+#define REGNO_ADDRESS_P(regno) \
+ REGNO_IN_RANGE_P ((regno), FIRST_ADDRESS_REGNUM, LAST_ADDRESS_REGNUM)
+#define REGNO_SP_P(regno) \
+ REGNO_IN_RANGE_P ((regno), STACK_POINTER_REGNUM, STACK_POINTER_REGNUM)
+#define REGNO_EXTENDED_P(regno) \
+ REGNO_IN_RANGE_P ((regno), FIRST_EXTENDED_REGNUM, LAST_EXTENDED_REGNUM)
#define REGNO_AM33_P(regno) \
(REGNO_DATA_P ((regno)) || REGNO_ADDRESS_P ((regno)) \
|| REGNO_EXTENDED_P ((regno)))
@@ -431,23 +461,6 @@ enum reg_class {
#define FIRST_PARM_OFFSET(FNDECL) 4
-/* Specify the registers used for certain standard purposes.
- The values of these macros are register numbers. */
-
-/* Register to use for pushing function arguments. */
-#define STACK_POINTER_REGNUM 9
-
-/* Base register for access to local variables of the function. */
-#define FRAME_POINTER_REGNUM 7
-
-/* Base register for access to arguments of the function. This
- is a fake register and will be eliminated into either the frame
- pointer or stack pointer. */
-#define ARG_POINTER_REGNUM 8
-
-/* Register in which static-chain is passed to a function. */
-#define STATIC_CHAIN_REGNUM 5
-
#define ELIMINABLE_REGS \
{{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
{ ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \
@@ -554,16 +567,18 @@ struct cum_arg {int nbytes; };
otherwise, FUNC is 0. */
#define FUNCTION_VALUE(VALTYPE, FUNC) \
- gen_rtx_REG (TYPE_MODE (VALTYPE), POINTER_TYPE_P (VALTYPE) ? 4 : 0)
+ gen_rtx_REG (TYPE_MODE (VALTYPE), POINTER_TYPE_P (VALTYPE) \
+ ? FIRST_ADDRESS_REGNUM : FIRST_DATA_REGNUM)
/* Define how to find the value returned by a library function
assuming the value has mode MODE. */
-#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, 0)
+#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, FIRST_DATA_REGNUM)
/* 1 if N is a possible register number for a function value. */
-#define FUNCTION_VALUE_REGNO_P(N) ((N) == 0 || (N) == 4)
+#define FUNCTION_VALUE_REGNO_P(N) \
+ ((N) == FIRST_DATA_REGNUM || (N) == FIRST_ADDRESS_REGNUM)
/* Return values > 8 bytes in length in memory. */
#define DEFAULT_PCC_STRUCT_RETURN 0
@@ -574,7 +589,7 @@ struct cum_arg {int nbytes; };
is passed to a function. On the MN10300 it's passed as
the first parameter. */
-#define STRUCT_VALUE 0
+#define STRUCT_VALUE FIRST_DATA_REGNUM
/* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
the stack pointer does not matter. The value is tested only in
diff --git a/gcc/configure b/gcc/configure
index 31bad5699a8..b7f282fa6ae 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -5986,7 +5986,7 @@ for machine in $build $host $target; do
xmake_file=sparc/x-sysv4
extra_parts="crt1.o crti.o crtn.o gmon.o crtbegin.o crtend.o"
case $machine in
- *-*-solaris2.0-4)
+ *-*-solaris2.[0-4])
float_format=i128
;;
*)
@@ -6315,16 +6315,16 @@ for machine in $build $host $target; do
then
if test x$gnu_ld = xyes
then
- target_cpu_default2=20
+ target_cpu_default2="MASK_GAS|MASK_SPLIT_ADDR"
else
- target_cpu_default2=16
+ target_cpu_default2="MASK_GAS"
fi
fi
;;
mips*-*-*)
if test x$gas = xyes
then
- target_cpu_default2=16
+ target_cpu_default2="MASK_GAS"
fi
;;
powerpc*-*-* | rs6000-*-*)
diff --git a/gcc/configure.in b/gcc/configure.in
index 83e23a1e648..07b16ba42f1 100644
--- a/gcc/configure.in
+++ b/gcc/configure.in
@@ -3366,7 +3366,9 @@ changequote([,])dnl
xmake_file=sparc/x-sysv4
extra_parts="crt1.o crti.o crtn.o gmon.o crtbegin.o crtend.o"
case $machine in
+changequote(,)dnl
*-*-solaris2.[0-4])
+changequote([,])dnl
float_format=i128
;;
*)
@@ -3703,16 +3705,16 @@ changequote([,])dnl
then
if test x$gnu_ld = xyes
then
- target_cpu_default2=20
+ target_cpu_default2="MASK_GAS|MASK_SPLIT_ADDR"
else
- target_cpu_default2=16
+ target_cpu_default2="MASK_GAS"
fi
fi
;;
mips*-*-*)
if test x$gas = xyes
then
- target_cpu_default2=16
+ target_cpu_default2="MASK_GAS"
fi
;;
powerpc*-*-* | rs6000-*-*)
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 7f96445a207..87a279d8a78 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,7 +1,6 @@
-2000-04-28 Jason Merrill <jason@casey.cygnus.com>
+2000-04-28 Cosmin Truta <cosmint@cs.ubbcluj.ro>
- * optimize.c (initialize_inlined_parameters): Call
- c_apply_type_quals_to_decl. Set DECL_INITIAL.
+ * decl.c (grok_op_properties): Add an extra check of argtypes.
2000-04-27 Mark Mitchell <mark@codesourcery.com>
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 78c41671957..deb9e8f3077 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -12361,20 +12361,21 @@ grok_op_properties (decl, virtualp, friendp)
cp_warning ("`%D' should return by value", decl);
/* 13.4.0.8 */
- if (argtypes)
- for (; argtypes != void_list_node ; argtypes = TREE_CHAIN (argtypes))
- if (TREE_PURPOSE (argtypes))
- {
- TREE_PURPOSE (argtypes) = NULL_TREE;
- if (name == ansi_opname[(int) POSTINCREMENT_EXPR]
- || name == ansi_opname[(int) POSTDECREMENT_EXPR])
- {
- if (pedantic)
- cp_pedwarn ("`%D' cannot have default arguments", decl);
- }
- else
- cp_error ("`%D' cannot have default arguments", decl);
- }
+ for (; argtypes && argtypes != void_list_node;
+ argtypes = TREE_CHAIN (argtypes))
+ if (TREE_PURPOSE (argtypes))
+ {
+ TREE_PURPOSE (argtypes) = NULL_TREE;
+ if (name == ansi_opname[(int) POSTINCREMENT_EXPR]
+ || name == ansi_opname[(int) POSTDECREMENT_EXPR])
+ {
+ if (pedantic)
+ cp_pedwarn ("`%D' cannot have default arguments", decl);
+ }
+ else
+ cp_error ("`%D' cannot have default arguments", decl);
+ }
+
}
}
diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c
index 39f8247f8d0..9863d4abfe1 100644
--- a/gcc/cp/optimize.c
+++ b/gcc/cp/optimize.c
@@ -419,8 +419,6 @@ initialize_inlined_parameters (id, args, fn)
/* Make an equivalent VAR_DECL. */
var = copy_decl_for_inlining (p, fn, VARRAY_TREE (id->fns, 0));
- c_apply_type_quals_to_decl (TYPE_QUALS (p), var);
-
/* Register the VAR_DECL as the equivalent for the PARM_DECL;
that way, when the PARM_DECL is encountered, it will be
automatically replaced by the VAR_DECL. */
@@ -432,8 +430,6 @@ initialize_inlined_parameters (id, args, fn)
this will not result in an extra copy: the TARGET_EXPR
representing the argument will be bound to VAR, and the
object will be constructed in VAR. */
- if (! TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (p)))
- DECL_INITIAL (var) = TREE_VALUE (a);
init_stmt = build_min_nt (EXPR_STMT,
build (INIT_EXPR, TREE_TYPE (p),
var, value));
diff --git a/gcc/cpphash.c b/gcc/cpphash.c
index fe594a2dadc..4c45161ee74 100644
--- a/gcc/cpphash.c
+++ b/gcc/cpphash.c
@@ -31,10 +31,80 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#undef abort
+/* Structure allocated for every #define. For a simple replacement
+ such as
+ #define foo bar
+
+ we allocate an object_defn structure; the expansion field points
+ to the replacement text. For a function-like macro we allocate a
+ funct_defn structure; nargs is the number of arguments - it can be zero,
+ e.g.
+ #define getchar() getc (stdin)
+
+ When there are args, the expansion is the replacement text with the
+ args squashed out, and the reflist is a list describing how to
+ build the output from the input: e.g., "3 chars, then the 1st arg,
+ then 9 chars, then the 3rd arg, then 0 chars, then the 2nd arg".
+ The chars here come from the expansion. Whatever is left of the
+ expansion after the last arg-occurrence is copied after that arg.
+ Note that the reflist can be arbitrarily long---
+ its length depends on the number of times the arguments appear in
+ the replacement text, not how many args there are. Example:
+ #define f(x) x+x+x+x+x+x+x would have replacement text "++++++" and
+ pattern list
+ { (0, 1), (1, 1), (1, 1), ..., (1, 1), NULL }
+ where (x, y) means (nchars, argno).
+
+ Note that EMPTY and IDENTITY macros have object_defn structures too,
+ but they're just used to hold the file, line, and column. The
+ expansion field will be NULL. */
+
+struct object_defn
+{
+ const U_CHAR *expansion;
+ unsigned int length;
+
+ const char *file; /* File, line, column of definition */
+ int line;
+ int col;
+};
+
+struct reflist
+{
+ const struct reflist *next;
+ char stringify; /* nonzero if this arg was preceded by a
+ # operator. */
+ char raw_before; /* Nonzero if a ## operator before arg. */
+ char raw_after; /* Nonzero if a ## operator after arg. */
+ char rest_args; /* Nonzero if this arg. absorbs the rest */
+ int nchars; /* Number of literal chars to copy before
+ this arg occurrence. */
+ int argno; /* Number of arg to substitute (origin-0) */
+};
+
+struct funct_defn
+{
+ int nargs;
+ int length; /* length of expansion string */
+ const U_CHAR *expansion;
+ char rest_args; /* Nonzero if last arg. absorbs the rest */
+ const struct reflist *pattern;
+
+ /* Names of macro args, concatenated in order with \0 between
+ them. The only use of this is that we warn on redefinition if
+ this differs between the old and new definitions. */
+ U_CHAR *argnames;
+
+ const char *file; /* File, line, column of definition */
+ int line;
+ int col;
+};
+
static unsigned int hash_HASHNODE PARAMS ((const void *));
static int eq_HASHNODE PARAMS ((const void *, const void *));
static void del_HASHNODE PARAMS ((void *));
-static void dump_DEFINITION PARAMS ((cpp_reader *, DEFINITION *));
+static void dump_funlike_macro PARAMS ((cpp_reader *,
+ const struct funct_defn *));
static int dump_hash_helper PARAMS ((void **, void *));
static void push_macro_expansion PARAMS ((cpp_reader *, const U_CHAR *,
@@ -43,22 +113,23 @@ static int unsafe_chars PARAMS ((cpp_reader *, int, int));
static int macro_cleanup PARAMS ((cpp_buffer *, cpp_reader *));
static enum cpp_ttype macarg PARAMS ((cpp_reader *, int));
static void special_symbol PARAMS ((cpp_reader *, HASHNODE *));
-static int compare_defs PARAMS ((cpp_reader *, DEFINITION *,
- DEFINITION *));
+static int compare_defs PARAMS ((cpp_reader *,
+ const struct funct_defn *,
+ const struct funct_defn *));
/* Initial hash table size. (It can grow if necessary - see hashtab.c.) */
#define HASHSIZE 500
-/* The arglist structure is built by create_definition to tell
- collect_expansion where the argument names begin. That
- is, for a define like "#define f(x,y,z) foo+x-bar*y", the arglist
- would contain pointers to the strings x, y, and z.
- collect_expansion would then build a DEFINITION node,
- with reflist nodes pointing to the places x, y, and z had
- appeared. So the arglist is just convenience data passed
- between these two routines. It is not kept around after
- the current #define has been processed and entered into the
- hash table. */
+/* The arglist structure is built by collect_params to tell
+ collect_funlike_expansion where the argument names begin. That is,
+ for a define like "#define f(x,y,z) foo+x-bar*y", the arglist would
+ contain pointers to the strings x, y, and z.
+ collect_funlike_expansion would then build a funct_defn node, with
+ reflist nodes pointing to the places x, y, and z had appeared.
+
+ The arglist is just convenience data passed between these two
+ routines. It is not kept around after the current #define has been
+ processed and entered into the hash table. */
struct arg
{
@@ -75,9 +146,9 @@ struct arglist
};
-static DEFINITION *
+static struct object_defn *
collect_objlike_expansion PARAMS ((cpp_reader *, cpp_toklist *));
-static DEFINITION *
+static struct funct_defn *
collect_funlike_expansion PARAMS ((cpp_reader *, cpp_toklist *,
struct arglist *, unsigned int));
static unsigned int collect_params PARAMS ((cpp_reader *, cpp_toklist *,
@@ -111,8 +182,9 @@ struct argdata
int stringified_length;
};
-static void scan_arguments PARAMS ((cpp_reader *, DEFINITION *,
- struct argdata *, const U_CHAR *));
+static void scan_arguments PARAMS ((cpp_reader *,
+ const struct funct_defn *,
+ struct argdata *, const U_CHAR *));
static void stringify PARAMS ((cpp_reader *, struct argdata *));
static void funlike_macroexpand PARAMS ((cpp_reader *, HASHNODE *,
struct argdata *));
@@ -160,11 +232,8 @@ del_HASHNODE (x)
void *x;
{
HASHNODE *h = (HASHNODE *)x;
-
- if (h->type == T_MACRO)
- _cpp_free_definition (h->value.defn);
- else if (h->type == T_MCONST)
- free ((void *) h->value.cpval);
+
+ _cpp_free_definition (h);
free ((void *) h->name);
free (h);
}
@@ -266,23 +335,35 @@ _cpp_init_macro_hash (pfile)
eq_HASHNODE, del_HASHNODE);
}
-/* Free a DEFINITION structure. Used by delete_macro, and by
- do_define when redefining macros. */
+/* Free the definition of macro H. */
void
-_cpp_free_definition (d)
- DEFINITION *d;
+_cpp_free_definition (h)
+ HASHNODE *h;
{
- struct reflist *ap, *nextap;
-
- for (ap = d->pattern; ap != NULL; ap = nextap)
+ if (h->type == T_XCONST)
+ free ((PTR) h->value.cpval);
+ else if (h->type == T_MACRO)
+ {
+ if (h->value.odefn->expansion)
+ free ((PTR) h->value.odefn->expansion);
+ free ((PTR) h->value.odefn);
+ }
+ else if (h->type == T_FMACRO)
{
- nextap = ap->next;
- free (ap);
+ const struct funct_defn *d = h->value.fdefn;
+ const struct reflist *ap, *nextap;
+
+ for (ap = d->pattern; ap != NULL; ap = nextap)
+ {
+ nextap = ap->next;
+ free ((PTR) ap);
+ }
+ if (d->argnames)
+ free ((PTR) d->argnames);
+ free ((PTR) d);
}
- if (d->argnames)
- free (d->argnames);
- free (d);
+ h->value.cpval = NULL;
}
static int
@@ -293,10 +374,10 @@ macro_cleanup (pbuf, pfile)
HASHNODE *m = pbuf->macro;
m->disabled = 0;
- if (m->type == T_FMACRO && pbuf->buf != m->value.defn->expansion)
- free ((PTR) pbuf->buf);
- else if (m->type != T_MACRO && m->type != T_FMACRO && m->type != T_CONST
- && m->type != T_MCONST && m->type != T_XCONST)
+ if ((m->type == T_FMACRO && pbuf->buf != m->value.fdefn->expansion)
+ || m->type == T_SPECLINE || m->type == T_FILE
+ || m->type == T_BASE_FILE || m->type == T_INCLUDE_LEVEL
+ || m->type == T_STDC)
free ((PTR) pbuf->buf);
return 0;
}
@@ -415,14 +496,14 @@ trad_stringify (pfile, base, len, argc, argv, pat, endpat, last)
}
/* Read a replacement list for an object-like macro, and build the
- DEFINITION structure. LIST contains the replacement list,
+ object_defn structure. LIST contains the replacement list,
beginning at 1. */
-static DEFINITION *
+static struct object_defn *
collect_objlike_expansion (pfile, list)
cpp_reader *pfile;
cpp_toklist *list;
{
- DEFINITION *defn;
+ struct object_defn *defn;
unsigned int i;
unsigned int start;
int last_was_paste = 0;
@@ -484,30 +565,26 @@ collect_objlike_expansion (pfile, list)
memcpy (exp, pfile->token_buffer + start, len);
exp[len] = '\0';
- defn = (DEFINITION *) xmalloc (sizeof (DEFINITION));
+ defn = (struct object_defn *) xmalloc (sizeof (struct object_defn));
defn->length = len;
defn->expansion = exp;
- defn->pattern = 0;
- defn->rest_args = 0;
- defn->argnames = 0;
- defn->nargs = -1;
return defn;
}
/* Read a replacement list for a function-like macro, and build the
- DEFINITION structure. LIST contains the replacement list,
+ funct_defn structure. LIST contains the replacement list,
beginning at REPLACEMENT. ARGLIST specifies the formal parameters
to look for in the text of the definition. */
-static DEFINITION *
+static struct funct_defn *
collect_funlike_expansion (pfile, list, arglist, replacement)
cpp_reader *pfile;
cpp_toklist *list;
struct arglist *arglist;
unsigned int replacement;
{
- DEFINITION *defn;
+ struct funct_defn *defn;
struct reflist *pat = 0, *endpat = 0;
enum cpp_ttype token;
unsigned int start, last;
@@ -643,7 +720,7 @@ collect_funlike_expansion (pfile, list, arglist, replacement)
memcpy (exp, pfile->token_buffer + start, len);
exp[len] = '\0';
- defn = (DEFINITION *) xmalloc (sizeof (DEFINITION));
+ defn = (struct funct_defn *) xmalloc (sizeof (struct funct_defn));
defn->length = len;
defn->expansion = exp;
defn->pattern = pat;
@@ -817,9 +894,9 @@ collect_params (pfile, list, arglist)
return i + 1;
}
-/* Create a DEFINITION node for a macro. The replacement text
- (including formal parameters if present) is in LIST. If FUNLIKE is
- true, this is a function-like macro. */
+/* Create a definition for a macro. The replacement text (including
+ formal parameters if present) is in LIST. If FUNLIKE is true, this
+ is a function-like macro. */
int
_cpp_create_definition (pfile, list, hp)
@@ -827,41 +904,29 @@ _cpp_create_definition (pfile, list, hp)
cpp_toklist *list;
HASHNODE *hp;
{
- DEFINITION *defn = 0;
- U_CHAR *cpval = 0;
+ struct funct_defn *fdefn = 0;
+ struct object_defn *odefn = 0;
enum node_type ntype;
int ok;
/* Special-case a few simple and common idioms:
#define TOKEN // nothing
#define TOKEN TOKEN
- #define TOKEN OTHERTOKEN
Might also be good to special-case these:
#define FUNC() // nothing
#define FUNC(a, b, ...) // nothing
- #define FUNC(a, b, c) FUNC(a, b, c)
- #define FUNC(a, b, c) foobar(a, b, c) */
+ #define FUNC(a, b, c) FUNC(a, b, c) */
if (list->tokens_used == 2)
ntype = T_EMPTY; /* Empty definition of object-like macro. */
- else if (list->tokens_used == 3 && list->tokens[1].type == CPP_NAME)
- {
- if (list->tokens[0].val.name.len == list->tokens[1].val.name.len
- && !strncmp (list->tokens[0].val.name.offset + list->namebuf,
- list->tokens[1].val.name.offset + list->namebuf,
- list->tokens[0].val.name.len))
- ntype = T_IDENTITY;
- else
- {
- ntype = T_MCONST;
- cpval = xmalloc (list->tokens[1].val.name.len + 1);
- memcpy (cpval, list->tokens[1].val.name.offset + list->namebuf,
- list->tokens[1].val.name.len);
- cpval[list->tokens[1].val.name.len] = '\0';
- }
- }
+ else if (list->tokens_used == 3 && list->tokens[1].type == CPP_NAME
+ && list->tokens[0].val.name.len == list->tokens[1].val.name.len
+ && !strncmp (list->tokens[0].val.name.offset + list->namebuf,
+ list->tokens[1].val.name.offset + list->namebuf,
+ list->tokens[0].val.name.len))
+ ntype = T_IDENTITY; /* Object like macro defined to itself. */
/* The macro is function-like only if the next character,
with no intervening whitespace, is '('. */
@@ -874,8 +939,8 @@ _cpp_create_definition (pfile, list, hp)
replacement = collect_params (pfile, list, &args);
if (replacement == 0)
return 0;
- defn = collect_funlike_expansion (pfile, list, &args, replacement);
- if (defn == 0)
+ fdefn = collect_funlike_expansion (pfile, list, &args, replacement);
+ if (fdefn == 0)
return 0;
ntype = T_FMACRO;
@@ -890,13 +955,20 @@ _cpp_create_definition (pfile, list, hp)
"The C standard requires whitespace after #define %s",
hp->name);
- defn = collect_objlike_expansion (pfile, list);
- if (defn == 0)
+ odefn = collect_objlike_expansion (pfile, list);
+ if (odefn == 0)
return 0;
ntype = T_MACRO;
}
+ if (ntype == T_EMPTY || ntype == T_IDENTITY)
+ {
+ odefn = xmalloc (sizeof (struct object_defn));
+ odefn->length = 0;
+ odefn->expansion = 0;
+ }
+
/* Check for a redefinition, and its legality. Redefining a macro
of whatever stripe is ok if the definitions are the same.
Redefining a built-in _constant_ (T_CONST or T_XCONST) is ok only
@@ -907,16 +979,20 @@ _cpp_create_definition (pfile, list, hp)
case T_VOID: ok = 1; break;
default: ok = 0; break;
- case T_MACRO: case T_FMACRO:
- ok = (ntype == hp->type && !compare_defs (pfile, defn, hp->value.defn));
+ case T_MACRO:
+ ok = (ntype == hp->type
+ && odefn->length == hp->value.odefn->length
+ && !strncmp (odefn->expansion, hp->value.odefn->expansion,
+ odefn->length));
+ break;
+ case T_FMACRO:
+ ok = (ntype == hp->type
+ && !compare_defs (pfile, fdefn, hp->value.fdefn));
break;
case T_IDENTITY:
case T_EMPTY:
ok = (ntype == hp->type);
break;
- case T_MCONST:
- ok = (ntype == hp->type && !strcmp (cpval, hp->value.cpval));
- break;
case T_CONST:
case T_XCONST:
ok = ! pfile->done_initializing;
@@ -928,26 +1004,45 @@ _cpp_create_definition (pfile, list, hp)
{
cpp_pedwarn (pfile, "\"%s\" redefined", hp->name);
if (pfile->done_initializing)
- cpp_pedwarn_with_file_and_line (pfile, hp->file, hp->line, hp->col,
+ {
+ const char *file;
+ unsigned int line, col;
+ if (hp->type == T_FMACRO)
+ {
+ file = hp->value.fdefn->file;
+ line = hp->value.fdefn->line;
+ col = hp->value.fdefn->col;
+ }
+ else
+ {
+ file = hp->value.odefn->file;
+ line = hp->value.odefn->line;
+ col = hp->value.odefn->col;
+ }
+ cpp_pedwarn_with_file_and_line (pfile, file, line, col,
"this is the location of the previous definition");
+ }
}
/* And replace the old definition (if any). */
- if (hp->type == T_MACRO || hp->type == T_FMACRO)
- _cpp_free_definition (hp->value.defn);
- else if (hp->type == T_MCONST || hp->type == T_XCONST)
- free ((PTR) hp->value.cpval);
-
- if (ntype == T_MACRO || ntype == T_FMACRO)
- hp->value.defn = defn;
- else
- hp->value.cpval = cpval;
+ _cpp_free_definition (hp);
hp->type = ntype;
- hp->file = CPP_BUFFER (pfile)->nominal_fname;
- hp->line = list->line;
- hp->col = list->tokens[0].col;
+ if (ntype == T_FMACRO)
+ {
+ fdefn->file = CPP_BUFFER (pfile)->nominal_fname;
+ fdefn->line = list->line;
+ fdefn->col = list->tokens[0].col;
+ hp->value.fdefn = fdefn;
+ }
+ else
+ {
+ odefn->file = CPP_BUFFER (pfile)->nominal_fname;
+ odefn->line = list->line;
+ odefn->col = list->tokens[0].col;
+ hp->value.odefn = odefn;
+ }
return 1;
}
@@ -1179,7 +1274,7 @@ _cpp_macroexpand (pfile, hp)
cpp_reader *pfile;
HASHNODE *hp;
{
- DEFINITION *defn;
+ const struct funct_defn *defn;
struct argdata *args;
unsigned int old_written;
int i;
@@ -1187,13 +1282,13 @@ _cpp_macroexpand (pfile, hp)
/* Object like macro - most common case. */
if (hp->type == T_MACRO)
{
- push_macro_expansion (pfile, hp->value.defn->expansion,
- hp->value.defn->length, hp);
+ push_macro_expansion (pfile, hp->value.odefn->expansion,
+ hp->value.odefn->length, hp);
return;
}
/* Or might it be a constant string? */
- if (hp->type == T_MCONST || hp->type == T_CONST || hp->type == T_XCONST)
+ if (hp->type == T_CONST || hp->type == T_XCONST)
{
const U_CHAR *cpval = hp->value.cpval;
if (cpval && *cpval != '\0')
@@ -1205,8 +1300,9 @@ _cpp_macroexpand (pfile, hp)
if (hp->type != T_FMACRO)
{
U_CHAR *xbuf;
- unsigned int len, old_written = CPP_WRITTEN (pfile);
-
+ unsigned int len;
+
+ old_written = CPP_WRITTEN (pfile);
special_symbol (pfile, hp);
len = CPP_WRITTEN (pfile) - old_written;
CPP_SET_WRITTEN (pfile, old_written);
@@ -1222,7 +1318,7 @@ _cpp_macroexpand (pfile, hp)
/* Okay, it's a full-on function-like macro... */
old_written = CPP_WRITTEN (pfile);
- defn = hp->value.defn;
+ defn = hp->value.fdefn;
args = alloca (MAX (defn->nargs, 1) * sizeof (struct argdata));
for (i = 0; i < MAX (defn->nargs, 1); i++)
@@ -1253,7 +1349,7 @@ _cpp_macroexpand (pfile, hp)
static void
scan_arguments (pfile, defn, args, name)
cpp_reader *pfile;
- DEFINITION *defn;
+ const struct funct_defn *defn;
struct argdata *args;
const U_CHAR *name;
{
@@ -1431,13 +1527,13 @@ funlike_macroexpand (pfile, hp, args)
HASHNODE *hp;
struct argdata *args;
{
- DEFINITION *defn = hp->value.defn;
+ const struct funct_defn *defn = hp->value.fdefn;
register U_CHAR *xbuf;
int xbuf_len;
- U_CHAR *exp = defn->expansion;
+ const U_CHAR *exp = defn->expansion;
int offset; /* offset in expansion, copied a piece at a time */
int totlen; /* total amount of exp buffer filled so far */
- struct reflist *ap, *last_ap;
+ const struct reflist *ap, *last_ap;
int i;
/* Compute length in characters of the macro's expansion.
@@ -1728,20 +1824,20 @@ push_macro_expansion (pfile, xbuf, len, hp)
foo(foo(baz(0, 0)) in K+R. This looks pathological to me.
If someone has a real-world example I would love to see it. */
if (hp->type != T_FMACRO
- || hp->value.defn->nargs == 0
- || hp->value.defn->pattern == 0
+ || hp->value.fdefn->nargs == 0
+ || hp->value.fdefn->pattern == 0
|| !CPP_TRADITIONAL (pfile))
hp->disabled = 1;
}
-/* Return zero if two DEFINITIONs are isomorphic. */
+/* Return zero if two funct_defns are isomorphic. */
static int
compare_defs (pfile, d1, d2)
cpp_reader *pfile;
- DEFINITION *d1, *d2;
+ const struct funct_defn *d1, *d2;
{
- struct reflist *a1, *a2;
+ const struct reflist *a1, *a2;
if (d1->nargs != d2->nargs)
return 1;
@@ -1794,23 +1890,21 @@ _cpp_dump_definition (pfile, hp)
if (hp->type == T_EMPTY)
/* do nothing */;
else if (hp->type == T_FMACRO)
- dump_DEFINITION (pfile, hp->value.defn);
+ dump_funlike_macro (pfile, hp->value.fdefn);
else
{
CPP_PUTC_Q (pfile, ' ');
if (hp->type == T_IDENTITY)
CPP_PUTS (pfile, hp->name, hp->length);
- else if (hp->type == T_MCONST)
- CPP_PUTS (pfile, hp->value.cpval, strlen (hp->value.cpval));
else if (hp->type == T_MACRO)
{
/* The first and last two characters of a macro expansion are
always "\r "; this needs to be trimmed out.
So we need length-4 chars of space, plus one for the NUL. */
- CPP_RESERVE (pfile, hp->value.defn->length - 4 + 1);
- CPP_PUTS_Q (pfile, hp->value.defn->expansion + 2,
- hp->value.defn->length - 4);
+ CPP_RESERVE (pfile, hp->value.odefn->length - 4 + 1);
+ CPP_PUTS_Q (pfile, hp->value.odefn->expansion + 2,
+ hp->value.odefn->length - 4);
}
else
cpp_ice (pfile, "invalid hash type %d in dump_definition", hp->type);
@@ -1820,15 +1914,15 @@ _cpp_dump_definition (pfile, hp)
}
static void
-dump_DEFINITION (pfile, defn)
+dump_funlike_macro (pfile, defn)
cpp_reader *pfile;
- DEFINITION *defn;
+ const struct funct_defn *defn;
{
- struct reflist *r;
- unsigned char **argv = (unsigned char **) alloca (defn->nargs *
- sizeof(char *));
+ const struct reflist *r;
+ const U_CHAR **argv = (const U_CHAR **) alloca (defn->nargs *
+ sizeof(const U_CHAR *));
int *argl = (int *) alloca (defn->nargs * sizeof(int));
- unsigned char *x;
+ const U_CHAR *x;
int i;
/* First extract the argument list. */
diff --git a/gcc/cpphash.h b/gcc/cpphash.h
index 2d2ea8d5c36..edb61f74e53 100644
--- a/gcc/cpphash.h
+++ b/gcc/cpphash.h
@@ -24,55 +24,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
typedef unsigned char U_CHAR;
-/* Structure allocated for every #define. For a simple replacement
- such as
- #define foo bar ,
- nargs = -1, the `pattern' list is null, and the expansion is just
- the replacement text. Nargs = 0 means a functionlike macro with no args,
- e.g.,
- #define getchar() getc (stdin) .
- When there are args, the expansion is the replacement text with the
- args squashed out, and the reflist is a list describing how to
- build the output from the input: e.g., "3 chars, then the 1st arg,
- then 9 chars, then the 3rd arg, then 0 chars, then the 2nd arg".
- The chars here come from the expansion. Whatever is left of the
- expansion after the last arg-occurrence is copied after that arg.
- Note that the reflist can be arbitrarily long---
- its length depends on the number of times the arguments appear in
- the replacement text, not how many args there are. Example:
- #define f(x) x+x+x+x+x+x+x would have replacement text "++++++" and
- pattern list
- { (0, 1), (1, 1), (1, 1), ..., (1, 1), NULL }
- where (x, y) means (nchars, argno). */
-
-struct reflist
-{
- struct reflist *next;
- char stringify; /* nonzero if this arg was preceded by a
- # operator. */
- char raw_before; /* Nonzero if a ## operator before arg. */
- char raw_after; /* Nonzero if a ## operator after arg. */
- char rest_args; /* Nonzero if this arg. absorbs the rest */
- int nchars; /* Number of literal chars to copy before
- this arg occurrence. */
- int argno; /* Number of arg to substitute (origin-0) */
-};
-
-typedef struct definition DEFINITION;
-struct definition
-{
- int nargs;
- int length; /* length of expansion string */
- U_CHAR *expansion;
- char rest_args; /* Nonzero if last arg. absorbs the rest */
- struct reflist *pattern;
-
- /* Names of macro args, concatenated in order with \0 between
- them. The only use of this is that we warn on redefinition if
- this differs between the old and new definitions. */
- U_CHAR *argnames;
-};
-
/* The structure of a node in the hash table. The hash table
has entries for all tokens defined by #define commands (type T_MACRO),
plus some special tokens like __LINE__ (these each have their own
@@ -94,35 +45,28 @@ enum node_type
T_CONST, /* Constant string, used by `__SIZE_TYPE__' etc */
T_XCONST, /* Ditto, but the string is malloced memory */
T_POISON, /* poisoned identifier */
- T_MCONST, /* object-like macro defined to a single identifier */
- T_MACRO, /* general object-like macro */
- T_FMACRO, /* general function-like macro */
+ T_MACRO, /* object-like macro */
+ T_FMACRO, /* function-like macro */
T_IDENTITY, /* macro defined to itself */
T_EMPTY /* macro defined to nothing */
};
-/* different kinds of things that can appear in the value field
- of a hash node. */
-union hashval
-{
- const char *cpval; /* some predefined macros */
- DEFINITION *defn; /* #define */
- struct hashnode *aschain; /* #assert */
-};
-
typedef struct hashnode HASHNODE;
struct hashnode
{
- const U_CHAR *name; /* the actual name */
- size_t length; /* length of token, for quick comparison */
- unsigned long hash; /* cached hash value */
- union hashval value; /* pointer to expansion, or whatever */
- enum node_type type; /* type of special token */
- int disabled; /* macro turned off for rescan? */
-
- const char *file; /* File, line, column of definition; */
- int line;
- int col;
+ unsigned int hash; /* cached hash value */
+ unsigned short length; /* length of name */
+ ENUM_BITFIELD(node_type) type : 8; /* node type */
+ char disabled; /* macro turned off for rescan? */
+
+ union {
+ const char *cpval; /* some predefined macros */
+ const struct object_defn *odefn; /* #define foo bar */
+ const struct funct_defn *fdefn; /* #define foo(x) bar(x) */
+ struct hashnode *aschain; /* #assert */
+ } value;
+
+ const U_CHAR *name;
};
/* List of directories to look for include files in. */
@@ -276,7 +220,7 @@ extern HASHNODE **_cpp_lookup_slot PARAMS ((cpp_reader *,
const U_CHAR *, int,
enum insert_option,
unsigned long *));
-extern void _cpp_free_definition PARAMS ((DEFINITION *));
+extern void _cpp_free_definition PARAMS ((HASHNODE *));
extern int _cpp_create_definition PARAMS ((cpp_reader *,
cpp_toklist *, HASHNODE *));
extern void _cpp_dump_definition PARAMS ((cpp_reader *, HASHNODE *));
diff --git a/gcc/cpplib.c b/gcc/cpplib.c
index 2d466ff1d55..06e828640a9 100644
--- a/gcc/cpplib.c
+++ b/gcc/cpplib.c
@@ -727,7 +727,6 @@ do_undef (pfile)
pass_thru_directive (hp->name, len, pfile, T_UNDEF);
if (hp->type != T_MACRO && hp->type != T_FMACRO
- && hp->type != T_MCONST
&& hp->type != T_EMPTY && hp->type != T_IDENTITY)
cpp_warning (pfile, "undefining `%s'", hp->name);
@@ -980,9 +979,7 @@ do_pragma_poison (pfile)
if (hp->type != T_POISON)
{
cpp_warning (pfile, "poisoning existing macro `%s'", hp->name);
- if (hp->type == T_MACRO)
- _cpp_free_definition (hp->value.defn);
- hp->value.defn = 0;
+ _cpp_free_definition (hp);
hp->type = T_POISON;
}
}
diff --git a/gcc/f/version.c b/gcc/f/version.c
index 59a9404520d..6fe1377034f 100644
--- a/gcc/f/version.c
+++ b/gcc/f/version.c
@@ -1 +1 @@
-const char *ffe_version_string = "0.5.25 20000428 (experimental)";
+const char *ffe_version_string = "0.5.25 20000430 (experimental)";
diff --git a/gcc/gcc.texi b/gcc/gcc.texi
index a12dd357ef4..380eba9813e 100644
--- a/gcc/gcc.texi
+++ b/gcc/gcc.texi
@@ -79,7 +79,7 @@
@c \global\normaloffset =0.75in
@c @end tex
-@ifinfo
+@ifnottex
@dircategory Programming
@direntry
* gcc: (gcc). The GNU Compiler Collection.
@@ -95,17 +95,17 @@ This file documents the internals of the GNU compiler.
@ifclear INTERNALS
This file documents the use of the GNU compiler.
@end ifclear
-
-Published by the Free Software Foundation
-59 Temple Place - Suite 330
+@sp 1
+Published by the Free Software Foundation@*
+59 Temple Place - Suite 330@*
Boston, MA 02111-1307 USA
-
+@sp 1
Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
-
+@sp 1
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.
-
+@sp 1
@ignore
Permission is granted to process this file through Tex and print the
results, provided the printed document carries copying permission
@@ -119,14 +119,14 @@ sections entitled ``GNU General Public License'' and ``Funding for Free
Software'' are included exactly as in the original, and provided that
the entire resulting derived work is distributed under the terms of a
permission notice identical to this one.
-
+@sp 1
Permission is granted to copy and distribute translations of this manual
into another language, under the above conditions for modified versions,
except that the sections entitled ``GNU General Public License'' and
``Funding for Free Software'', and this permission notice, may be
included in translations approved by the Free Software Foundation
instead of in the original English.
-@end ifinfo
+@end ifnottex
@setchapternewpage odd
@c @finalout
@@ -184,7 +184,7 @@ instead of in the original English.
@end titlepage
@page
-@ifinfo
+@ifnottex
@node Top, G++ and GCC,, (DIR)
@top Introduction
@@ -209,7 +209,7 @@ as well as its new features and incompatibilities, and how to report
bugs. It corresponds to GCC version 2.96.
@end ifclear
-@end ifinfo
+@end ifnottex
@menu
@ifset USING
* G++ and GCC:: You can compile C or C++ programs.
@@ -4359,9 +4359,9 @@ modification follow.
@iftex
@unnumberedsec TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
@end iftex
-@ifinfo
+@ifnottex
@center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-@end ifinfo
+@end ifnottex
@enumerate 0
@item
@@ -4584,9 +4584,9 @@ of promoting the sharing and reuse of software generally.
@iftex
@heading NO WARRANTY
@end iftex
-@ifinfo
+@ifnottex
@center NO WARRANTY
-@end ifinfo
+@end ifnottex
@item
BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
@@ -4614,9 +4614,9 @@ POSSIBILITY OF SUCH DAMAGES.
@iftex
@heading END OF TERMS AND CONDITIONS
@end iftex
-@ifinfo
+@ifnottex
@center END OF TERMS AND CONDITIONS
-@end ifinfo
+@end ifnottex
@page
@unnumberedsec How to Apply These Terms to Your New Programs
diff --git a/gcc/java/parse.c b/gcc/java/parse.c
index f426eb984b1..483b9e60774 100644
--- a/gcc/java/parse.c
+++ b/gcc/java/parse.c
@@ -2387,7 +2387,7 @@ static const short yycheck[] = { 3,
#define YYPURE 1
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
-#line 3 "/usr/share/misc/bison.simple"
+#line 3 "/usr/lib/bison.simple"
/* Skeleton output parser for bison,
Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
@@ -2404,7 +2404,7 @@ static const short yycheck[] = { 3,
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* As a special exception, when this file is copied by Bison into a
Bison output file, you may use that output file without restriction.
@@ -2538,10 +2538,8 @@ int yydebug; /* nonzero means print parse trace */
/* Prevent warning if -Wstrict-prototypes. */
#ifdef __GNUC__
-#ifndef YYPARSE_PARAM
int yyparse (void);
#endif
-#endif
#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
@@ -2582,7 +2580,7 @@ __yy_memcpy (char *to, char *from, int count)
#endif
#endif
-#line 196 "/usr/share/misc/bison.simple"
+#line 196 "/usr/lib/bison.simple"
/* The user can define YYPARSE_PARAM as the name of an argument to be passed
into yyparse. The argument should have type void *.
@@ -4978,7 +4976,7 @@ case 503:
break;}
}
/* the action file gets copied in in place of this dollarsign */
-#line 498 "/usr/share/misc/bison.simple"
+#line 498 "/usr/lib/bison.simple"
yyvsp -= yylen;
yyssp -= yylen;
diff --git a/gcc/jump.c b/gcc/jump.c
index 7d7c5fbd519..2cf98990dd4 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -297,7 +297,7 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan,
for (insn = f; insn; insn = next)
{
rtx reallabelprev;
- rtx temp, temp1, temp2 = NULL_RTX;
+ rtx temp, temp1, temp2 = NULL_RTX, temp4;
rtx nlabel;
int this_is_simplejump, this_is_condjump;
int this_is_condjump_in_parallel;
diff --git a/gcc/pcp.h b/gcc/pcp.h
deleted file mode 100644
index 4065c95de9e..00000000000
--- a/gcc/pcp.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/* pcp.h -- Describes the format of a precompiled file
- Copyright (C) 1990 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. */
-
-
-
-/* Structure allocated for every string in a precompiled file */
-typedef struct stringdef STRINGDEF;
-struct stringdef
-{
- U_CHAR *contents; /* String to include */
- int len; /* Its length */
- int writeflag; /* Whether we write this */
- int lineno; /* Linenumber of source file */
- const U_CHAR *filename; /* Name of source file */
- STRINGDEF *chain; /* Global list of strings in natural order */
- int output_mark; /* Where in the output this goes */
-};
-
-typedef struct keydef KEYDEF;
-struct keydef
-{
- STRINGDEF *str;
- KEYDEF *chain;
-};
-
-/* Format: */
-/* A precompiled file starts with a series of #define and #undef
- statements:
- #define MAC DEF --- Indicates MAC must be defined with defn DEF
- #define MAC --- Indicates MAC must be defined with any defn
- #undef MAC --- Indicates MAC cannot be defined
-
-These preconditions must be true for a precompiled file to be used.
-The preconditions section is null terminated. */
-
-/* Then, there is a four byte number (in network byte order) which */
- /* indicates the number of strings the file contains. */
-
-/* Each string contains a STRINGDEF structure. The only component of */
- /* the STRINGDEF structure which is used is the lineno field, which */
- /* should hold the line number in the original header file. */
- /* Then follows the string, followed by a null. Then comes a four */
- /* byte number (again, in network byte order) indicating the number */
- /* of keys for this string. Each key is a KEYDEF structure, with */
- /* irrelevant contents, followed by the null-terminated string. */
-
-/* If the number of keys is 0, then there are no keys for the string, */
- /* in other words, the string will never be included. If the number */
- /* of keys is -1, this is a special flag indicating there are no keys */
- /* in the file, and the string is mandatory (that is, it must be */
- /* included regardless in the included output). */
-
-/* A file, then, looks like this:
-
- Precondition 1
- Precondition 2
- .
- .
- .
- <NUL>
- Number of strings
- STRINGDEF
- String . . . <NUL>
- Number of keys
- KEYDEF
- Key . . . <NUL>
- KEYDEF
- Key . . . <NUL>
- .
- .
- .
- STRINGDEF
- String . . . <NUL>
- Number of keys
- KEYDEF
- Key . . . <NUL>
- .
- .
- .
- .
- .
- .
-
-*/
diff --git a/gcc/po/ChangeLog b/gcc/po/ChangeLog
index f0e3041bbbe..daf0182ca21 100644
--- a/gcc/po/ChangeLog
+++ b/gcc/po/ChangeLog
@@ -1,3 +1,7 @@
+2000-04-28 Zack Weinberg <zack@wolery.cumb.org>
+
+ * POTFILES.in: Remove pcp.h.
+
2000-04-18 Zack Weinberg <zack@wolery.cumb.org>
* POTFILES.in: Remove cccp.c and cexp.c. Comment out
diff --git a/gcc/po/POTFILES.in b/gcc/po/POTFILES.in
index 994e94d867f..029a870f74f 100644
--- a/gcc/po/POTFILES.in
+++ b/gcc/po/POTFILES.in
@@ -713,7 +713,6 @@ objc/objc-act.h
objc/objc-parse.c
optabs.c
output.h
-pcp.h
../libiberty/pexecute.c
#po/cat-id-tbl.c contains the translation tables themselves
prefix.c
diff --git a/gcc/regmove.c b/gcc/regmove.c
index 3b4a7e660e0..5b244a028f5 100644
--- a/gcc/regmove.c
+++ b/gcc/regmove.c
@@ -2100,6 +2100,7 @@ static struct csa_memlist *record_one_stack_memref
static int try_apply_stack_adjustment
PARAMS ((rtx, struct csa_memlist *, HOST_WIDE_INT, HOST_WIDE_INT));
static void combine_stack_adjustments_for_block PARAMS ((basic_block));
+static int record_stack_memrefs PARAMS ((rtx *, void *));
/* Main entry point for stack adjustment combination. */
@@ -2258,6 +2259,51 @@ try_apply_stack_adjustment (insn, memlist, new_adjust, delta)
return 0;
}
+/* Called via for_each_rtx and used to record all stack memory references in
+ the insn and discard all other stack pointer references. */
+struct record_stack_memrefs_data
+{
+ rtx insn;
+ struct csa_memlist *memlist;
+};
+
+static int
+record_stack_memrefs (xp, data)
+ rtx *xp;
+ void *data;
+{
+ rtx x = *xp;
+ struct record_stack_memrefs_data *d =
+ (struct record_stack_memrefs_data *) data;
+ if (!x)
+ return 0;
+ switch (GET_CODE (x))
+ {
+ case MEM:
+ if (!reg_mentioned_p (stack_pointer_rtx, x))
+ return -1;
+ /* We are not able to handle correctly all possible memrefs containing
+ stack pointer, so this check is neccesary. */
+ if (stack_memref_p (x))
+ {
+ d->memlist = record_one_stack_memref (d->insn, xp, d->memlist);
+ return -1;
+ }
+ return 1;
+ case REG:
+ /* ??? We want be able to handle non-memory stack pointer references
+ later. For now just discard all insns refering to stack pointer
+ outside mem expressions. We would probably want to teach
+ validate_replace to simplify expressions first. */
+ if (x == stack_pointer_rtx)
+ return 1;
+ break;
+ default:
+ break;
+ }
+ return 0;
+}
+
/* Subroutine of combine_stack_adjustments, called for each basic block. */
static void
@@ -2269,6 +2315,7 @@ combine_stack_adjustments_for_block (bb)
struct csa_memlist *memlist = NULL;
rtx pending_delete;
rtx insn, next;
+ struct record_stack_memrefs_data data;
for (insn = bb->head; ; insn = next)
{
@@ -2277,7 +2324,7 @@ combine_stack_adjustments_for_block (bb)
pending_delete = NULL_RTX;
next = NEXT_INSN (insn);
- if (GET_RTX_CLASS (GET_CODE (insn)) != 'i')
+ if (! INSN_P (insn))
goto processed;
set = single_set_for_csa (insn);
@@ -2337,23 +2384,6 @@ combine_stack_adjustments_for_block (bb)
goto processed;
}
- /* Find loads from stack memory and record them. */
- if (last_sp_set && stack_memref_p (src)
- && ! reg_mentioned_p (stack_pointer_rtx, dest))
- {
- memlist = record_one_stack_memref (insn, &SET_SRC (set), memlist);
- goto processed;
- }
-
- /* Find stores to stack memory and record them. */
- if (last_sp_set && stack_memref_p (dest)
- && ! reg_mentioned_p (stack_pointer_rtx, src))
- {
- memlist = record_one_stack_memref (insn, &SET_DEST (set),
- memlist);
- goto processed;
- }
-
/* Find a predecrement of exactly the previous adjustment and
turn it into a direct store. Obviously we can't do this if
there were any intervening uses of the stack pointer. */
@@ -2380,6 +2410,16 @@ combine_stack_adjustments_for_block (bb)
}
}
+ data.insn = insn;
+ data.memlist = memlist;
+ if (GET_CODE (insn) != CALL_INSN && last_sp_set
+ && !for_each_rtx (&PATTERN (insn), record_stack_memrefs, &data))
+ {
+ memlist = data.memlist;
+ goto processed;
+ }
+ memlist = data.memlist;
+
/* Otherwise, we were not able to process the instruction.
Do not continue collecting data across such a one. */
if (last_sp_set
diff --git a/gcc/version.c b/gcc/version.c
index 979c0097a29..54d6387d6ea 100644
--- a/gcc/version.c
+++ b/gcc/version.c
@@ -1,4 +1,4 @@
#include "gansidecl.h"
#include "version.h"
-const char *const version_string = "2.96 20000428 (experimental)";
+const char *const version_string = "2.96 20000430 (experimental)";
diff --git a/include/ChangeLog b/include/ChangeLog
index f17e65d42a3..b905153da02 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,10 @@
+2000-04-28 Kenneth Block <block@zk3.dec.com>
+ Jason Merrill <jason@casey.cygnus.com>
+
+ * demangle.h (libiberty_demanglers): new table for different styles.
+ (cplus_demangle_set_style): New function for setting style.
+ (cplus_demangle_name_to_style): New function to translate name.
+
2000-04-24 Mark Mitchell <mark@codesourcery.com>
* hashtab.h (hash_pointer): Declare.
diff --git a/include/demangle.h b/include/demangle.h
index 63fe5e2adf4..2ebc2a5043f 100644
--- a/include/demangle.h
+++ b/include/demangle.h
@@ -78,6 +78,16 @@ extern enum demangling_styles
#define HP_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_HP)
#define EDG_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_EDG)
+/* Provide information about the available demangle styles. This code is
+ pulled from gdb into libiberty because it is useful to binutils also. */
+
+extern struct demangler_engine
+{
+ char *demangling_style_name;
+ enum demangling_styles demangling_style;
+ char *demangling_style_doc;
+} libiberty_demanglers[];
+
extern char *
cplus_demangle PARAMS ((const char *mangled, int options));
@@ -92,4 +102,9 @@ cplus_mangle_opname PARAMS ((const char *opname, int options));
extern void
set_cplus_marker_for_demangling PARAMS ((int ch));
+extern enum demangling_styles
+cplus_demangle_set_style PARAMS ((enum demangling_styles style));
+
+extern enum demangling_styles
+cplus_demangle_name_to_style PARAMS ((const char *name));
#endif /* DEMANGLE_H */
diff --git a/libf2c/libF77/Version.c b/libf2c/libF77/Version.c
index 7fe4fad419d..1a8d61fb4ec 100644
--- a/libf2c/libF77/Version.c
+++ b/libf2c/libF77/Version.c
@@ -3,7 +3,7 @@ static char junk[] = "\n@(#)LIBF77 VERSION 19991115\n";
/*
*/
-char __G77_LIBF77_VERSION__[] = "0.5.25 20000428 (prerelease)";
+char __G77_LIBF77_VERSION__[] = "0.5.25 20000430 (prerelease)";
/*
2.00 11 June 1980. File version.c added to library.
diff --git a/libf2c/libI77/Version.c b/libf2c/libI77/Version.c
index ead28d6f2cd..0ffa5af25d6 100644
--- a/libf2c/libI77/Version.c
+++ b/libf2c/libI77/Version.c
@@ -3,7 +3,7 @@ static char junk[] = "\n@(#) LIBI77 VERSION pjw,dmg-mods 19991115\n";
/*
*/
-char __G77_LIBI77_VERSION__[] = "0.5.25 20000428 (prerelease)";
+char __G77_LIBI77_VERSION__[] = "0.5.25 20000430 (prerelease)";
/*
2.01 $ format added
diff --git a/libf2c/libU77/Version.c b/libf2c/libU77/Version.c
index 7c1c494be6b..13b14df8a1b 100644
--- a/libf2c/libU77/Version.c
+++ b/libf2c/libU77/Version.c
@@ -1,6 +1,6 @@
static char junk[] = "\n@(#) LIBU77 VERSION 19980709\n";
-char __G77_LIBU77_VERSION__[] = "0.5.25 20000428 (prerelease)";
+char __G77_LIBU77_VERSION__[] = "0.5.25 20000430 (prerelease)";
#include <stdio.h>
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index b71886dc58c..77cbf4faa01 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,15 @@
+2000-04-29 Alexandre Oliva <aoliva@cygnus.com>
+
+ * Makefile.in (maintainer-clean-subdir): Fix handling of empty
+ SUBDIRS.
+
+2000-04-28 Kenneth Block <block@zk3.dec.com>
+ Jason Merrill <jason@casey.cygnus.com>
+
+ * cplus-dem.c (libiberty_demanglers): New table for demangle styles.
+ (cplus_demangle_set_style): New function for setting style.
+ (cplus_demangle_name_to_style): New function to translate name.
+
2000-04-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* aclocal.m4: New file with new test libiberty_AC_FUNC_STRNCMP.
diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
index acb60119335..8b4bcab5ade 100644
--- a/libiberty/Makefile.in
+++ b/libiberty/Makefile.in
@@ -1,6 +1,6 @@
#
# Makefile
-# Copyright (C) 1990, 91, 91 - 99, 2000
+# Copyright (C) 1990, 91-99, 2000
# Free Software Foundation
#
# This file is part of the libiberty library.
@@ -244,9 +244,9 @@ all-subdir check-subdir installcheck-subdir info-subdir \
install-info-subdir clean-info-subdir dvi-subdir install-subdir \
etags-subdir mostlyclean-subdir clean-subdir distclean-subdir \
maintainer-clean-subdir:
- @if test "x$(SUBDIRS)" = x; then exit 0; fi; \
+ @subdirs='$(SUBDIRS)'; \
target=`echo $@ | sed -e 's/-subdir//'`; \
- for dir in $(SUBDIRS) ; do \
+ for dir in $$subdirs ; do \
cd $$dir && $(MAKE) $$target; \
done
diff --git a/libiberty/cplus-dem.c b/libiberty/cplus-dem.c
index 0c49c55ff6e..4ea2c958329 100644
--- a/libiberty/cplus-dem.c
+++ b/libiberty/cplus-dem.c
@@ -252,6 +252,49 @@ typedef enum type_kind_t
tk_real
} type_kind_t;
+struct demangler_engine libiberty_demanglers[] =
+{
+ {
+ AUTO_DEMANGLING_STYLE_STRING,
+ auto_demangling,
+ "Automatic selection based on executable"
+ }
+ ,
+ {
+ GNU_DEMANGLING_STYLE_STRING,
+ gnu_demangling,
+ "GNU (g++) style demangling"
+ }
+ ,
+ {
+ LUCID_DEMANGLING_STYLE_STRING,
+ lucid_demangling,
+ "Lucid (lcc) style demangling"
+ }
+ ,
+ {
+ ARM_DEMANGLING_STYLE_STRING,
+ arm_demangling,
+ "ARM style demangling"
+ }
+ ,
+ {
+ HP_DEMANGLING_STYLE_STRING,
+ hp_demangling,
+ "HP (aCC) style demangling"
+ }
+ ,
+ {
+ EDG_DEMANGLING_STYLE_STRING,
+ edg_demangling,
+ "EDG style demangling"
+ }
+ ,
+ {
+ NULL, unknown_demangling, NULL
+ }
+};
+
#define STRING_EMPTY(str) ((str) -> b == (str) -> p)
#define PREPEND_BLANK(str) {if (!STRING_EMPTY(str)) \
string_prepend(str, " ");}
@@ -733,6 +776,7 @@ cplus_demangle_opname (opname, result, options)
return ret;
}
+
/* Takes operator name as e.g. "++" and returns mangled
operator name (e.g. "postincrement_expr"), or NULL if not found.
@@ -758,6 +802,40 @@ cplus_mangle_opname (opname, options)
return (0);
}
+/* Add a routine to set the demangling style to be sure it is valid and
+ allow for any demangler initialization that maybe necessary. */
+
+enum demangling_styles
+cplus_demangle_set_style (style)
+ enum demangling_styles style;
+{
+ struct demangler_engine *demangler = libiberty_demanglers;
+
+ for (; demangler->demangling_style != unknown_demangling; ++demangler)
+ if (style == demangler->demangling_style)
+ {
+ current_demangling_style = style;
+ return current_demangling_style;
+ }
+
+ return unknown_demangling;
+}
+
+/* Do string name to style translation */
+
+enum demangling_styles
+cplus_demangle_name_to_style (name)
+ const char *name;
+{
+ struct demangler_engine *demangler = libiberty_demanglers;
+
+ for (; demangler->demangling_style != unknown_demangling; ++demangler)
+ if (strcmp (name, demangler->demangling_style_name) == 0)
+ return demangler->demangling_style;
+
+ return unknown_demangling;
+}
+
/* char *cplus_demangle (const char *mangled, int options)
If MANGLED is a mangled function name produced by GNU C++, then
@@ -4421,16 +4499,43 @@ demangle_it (mangled_name)
}
}
+static void
+print_demangler_list (stream)
+ FILE *stream;
+{
+ struct demangler_engine *demangler;
+
+ fprintf (stream, "{%s", libiberty_demanglers->demangling_style_name);
+
+ for (demangler = libiberty_demanglers + 1;
+ demangler->demangling_style != unknown_demangling;
+ ++demangler)
+ fprintf (stream, ",%s", demangler->demangling_style_name);
+
+ fprintf (stream, "}");
+}
+
static void
usage (stream, status)
FILE *stream;
int status;
{
fprintf (stream, "\
-Usage: %s [-_] [-n] [-s {gnu,lucid,arm,hp,edg}] [--strip-underscores]\n\
- [--no-strip-underscores] [--format={gnu,lucid,arm,hp,edg}]\n\
- [--help] [--version] [arg...]\n",
+Usage: %s [-_] [-n] [--strip-underscores] [--no-strip-underscores] \n",
program_name);
+
+ fprintf (stream, "\
+ [-s ");
+ print_demangler_list (stream);
+ fprintf (stream, "]\n");
+
+ fprintf (stream, "\
+ [--format ");
+ print_demangler_list (stream);
+ fprintf (stream, "]\n");
+
+ fprintf (stream, "\
+ [--help] [--version] [arg...]\n");
exit (status);
}
@@ -4553,32 +4658,19 @@ main (argc, argv)
flags |= DMGL_JAVA;
break;
case 's':
- if (strcmp (optarg, "gnu") == 0)
- {
- current_demangling_style = gnu_demangling;
- }
- else if (strcmp (optarg, "lucid") == 0)
- {
- current_demangling_style = lucid_demangling;
- }
- else if (strcmp (optarg, "arm") == 0)
- {
- current_demangling_style = arm_demangling;
- }
- else if (strcmp (optarg, "hp") == 0)
- {
- current_demangling_style = hp_demangling;
- }
- else if (strcmp (optarg, "edg") == 0)
- {
- current_demangling_style = edg_demangling;
- }
- else
- {
- fprintf (stderr, "%s: unknown demangling style `%s'\n",
- program_name, optarg);
- return (1);
- }
+ {
+ enum demangling_styles style;
+
+ style = cplus_demangle_name_to_style (optarg);
+ if (style == unknown_demangling)
+ {
+ fprintf (stderr, "%s: unknown demangling style `%s'\n",
+ program_name, optarg);
+ return (1);
+ }
+ else
+ cplus_demangle_set_style (style);
+ }
break;
}
}