diff options
author | Marc Espie <espie@cvs.openbsd.org> | 1999-06-17 21:01:31 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 1999-06-17 21:01:31 +0000 |
commit | 94facf520a7352fcca192b8a9e4e3edf677768ca (patch) | |
tree | 1807bc44a0ae1a185c651d140c38fe7c67ffc055 /gnu/egcs | |
parent | dade34163c221f533c2ad44cf8731df86a1da725 (diff) |
Update to 990608 snapshot.
Highlights:
- official fix for an alpha bug,
- cpp changes semantic slightly,
- valarray in libstdc++.
Diffstat (limited to 'gnu/egcs')
-rw-r--r-- | gnu/egcs/gcc/cpp.texi | 108 | ||||
-rw-r--r-- | gnu/egcs/gcc/dwarf2out.c | 62 | ||||
-rw-r--r-- | gnu/egcs/gcc/expr.h | 8 | ||||
-rw-r--r-- | gnu/egcs/gcc/fixproto | 25 | ||||
-rw-r--r-- | gnu/egcs/gcc/flow.c | 36 | ||||
-rw-r--r-- | gnu/egcs/gcc/function.h | 29 | ||||
-rw-r--r-- | gnu/egcs/gcc/haifa-sched.c | 13 |
7 files changed, 222 insertions, 59 deletions
diff --git a/gnu/egcs/gcc/cpp.texi b/gnu/egcs/gcc/cpp.texi index 7552cf97d61..ca501379577 100644 --- a/gnu/egcs/gcc/cpp.texi +++ b/gnu/egcs/gcc/cpp.texi @@ -2658,7 +2658,9 @@ warnings. @item -Wtrigraphs @findex -Wtrigraphs -Warn if any trigraphs are encountered (assuming they are enabled). +Warn if any trigraphs are encountered. Currently this only works if you +have turned trigraphs on with @samp{-trigraphs} or @samp{-ansi}; in the +future this restriction will be removed. @item -Wcomment @findex -Wcomment @@ -2756,6 +2758,12 @@ is not predefined. @findex -undef Do not predefine any nonstandard macros. +@item -gcc +@findex -gcc +Define the macros @var{__GNUC__} and @var{__GNUC_MINOR__}. These are +defined automatically when you use @samp{gcc -E}; you can turn them off +in that case with @samp{-no-gcc}. + @item -A @var{predicate}(@var{answer}) @findex -A Make an assertion with the predicate @var{predicate} and answer @@ -2763,7 +2771,8 @@ Make an assertion with the predicate @var{predicate} and answer @noindent You can use @samp{-A-} to disable all predefined assertions; it also -undefines all predefined macros that identify the type of target system. +undefines all predefined macros and all macros that preceded it on the +command line. @item -dM @findex -dM @@ -2874,48 +2883,75 @@ Add a directory to the beginning of the second include path, marking it as a system directory, so that it gets the same special treatment as is applied to the standard system directories. -@item -lang-c -@itemx -lang-c89 -@itemx -lang-c++ -@itemx -lang-objc -@itemx -lang-objc++ -@findex -lang-c -@findex -lang-c89 -@findex -lang-c++ -@findex -lang-objc -@findex -lang-objc++ -Specify the source language. @samp{-lang-c} is the default; it -allows recognition of C++ comments (comments that begin with -@samp{//} and end at end of line) and hexadecimal floating-point constants, -since these features will most likely appear in the next C standard. -@samp{-lang-c89} disables recognition of C++ comments and -hexadecimal floating-point constants. @samp{-lang-c++} -handles C++ comment syntax and includes extra default include -directories for C++. @samp{-lang-objc} enables the Objective C -@samp{#import} directive. @samp{-lang-objc++} enables both C++ and Objective C -extensions. - -These options are generated by the compiler driver @code{gcc}, but not -passed from the @samp{gcc} command line unless you use the driver's -@samp{-Wp} option. - -@item -lint +@item -x c +@itemx -x c++ +@itemx -x objective-c +@itemx -x assembler-with-cpp +@findex -x c +@findex -x objective-c +@findex -x assembler-with-cpp +Specify the source language: C, C++, Objective-C, or assembly. This has +nothing to do with standards conformance or extensions; it merely +selects which base syntax to expect. If you give none of these options, +cpp will deduce the language from the extension of the source file: +@samp{.c}, @samp{.cc}, @samp{.m}, or @samp{.S}. Some other common +extensions for C++ and assembly are also recognized. If cpp does not +recognize the extension, it will treat the file as C; this is the most +generic mode. + +@strong{Note:} Previous versions of cpp accepted a @samp{-lang} option +which selected both the language and the standards conformance level. +This option has been removed, because it conflicts with the @samp{-l} +option. + +@item -std=@var{standard} +@itemx -ansi +@findex -std +@findex -ansi +Specify the standard to which the code should conform. Currently cpp +only knows about the standards for C; other language standards will be +added in the future. + +@var{standard} +may be one of: +@table @code +@item iso9899:1990 +The ISO C standard from 1990. + +@item iso9899:199409 +@itemx c89 +The 1990 C standard, as amended in 1994. @samp{c89} is the customary +shorthand for this version of the standard. + +The @samp{-ansi} option is equivalent to @samp{-std=c89}. + +@item iso9899:199x +@itemx c9x +The revised ISO C standard, which is expected to be promulgated some +time in 1999. It has not been approved yet, hence the @samp{x}. + +@item gnu89 +The 1990 C standard plus GNU extensions. This is the default. + +@item gnu9x +The 199x C standard plus GNU extensions. +@end table + +@item -Wp,-lint +@findex -lint Look for commands to the program checker @code{lint} embedded in comments, and emit them preceded by @samp{#pragma lint}. For example, the comment @samp{/* NOTREACHED */} becomes @samp{#pragma lint NOTREACHED}. -This option is available only when you call @code{cpp} directly; -@code{gcc} will not pass it from its command line. +Because of the clash with @samp{-l}, you must use the awkward syntax +above. In a future release, this option will be replaced by +@samp{-flint} or @samp{-Wlint}; we are not sure which yet. @item -$ @findex -$ -Forbid the use of @samp{$} in identifiers. This was formerly required -for strict conformance to the C Standard before the standard was -corrected. - -This option is available only when you call @code{cpp} directly; -@code{gcc} will not pass it from its command line. +Forbid the use of @samp{$} in identifiers. The C standard does not +permit this, but it is a common extension. @end table diff --git a/gnu/egcs/gcc/dwarf2out.c b/gnu/egcs/gcc/dwarf2out.c index 659b119f4bd..f75d2c1e4b7 100644 --- a/gnu/egcs/gcc/dwarf2out.c +++ b/gnu/egcs/gcc/dwarf2out.c @@ -2426,6 +2426,22 @@ static unsigned pending_types; be enough for most typical programs. */ #define PENDING_TYPES_INCREMENT 64 +/* A pointer to the base of a list of incomplete types which might be + completed at some later time. */ + +static tree *incomplete_types_list; + +/* Number of elements currently allocated for the incomplete_types_list. */ +static unsigned incomplete_types_allocated; + +/* Number of elements of incomplete_types_list currently in use. */ +static unsigned incomplete_types; + +/* Size (in elements) of increments by which we may expand the incomplete + types list. Actually, a single hunk of space of this size should + be enough for most typical programs. */ +#define INCOMPLETE_TYPES_INCREMENT 64 + /* Record whether the function being analyzed contains inlined functions. */ static int current_function_has_inlines; #if 0 && defined (MIPS_DEBUGGING_INFO) @@ -2728,8 +2744,10 @@ static char debug_line_section_label[MAX_ARTIFICIAL_LABEL_BYTES]; dyn_string_append (STR, NAME + 1); \ else \ { \ + char *newstr; \ + STRIP_NAME_ENCODING (newstr, NAME); \ dyn_string_append (STR, user_label_prefix); \ - dyn_string_append (STR, NAME); \ + dyn_string_append (STR, newstr); \ } \ } \ while (0) @@ -8033,6 +8051,39 @@ output_pending_types_for_scope (context_die) } } +/* Remember a type in the incomplete_types_list. */ + +static void +add_incomplete_type (type) + tree type; +{ + if (incomplete_types == incomplete_types_allocated) + { + incomplete_types_allocated += INCOMPLETE_TYPES_INCREMENT; + incomplete_types_list + = (tree *) xrealloc (incomplete_types_list, + sizeof (tree) * incomplete_types_allocated); + } + + incomplete_types_list[incomplete_types++] = type; +} + +/* Walk through the list of incomplete types again, trying once more to + emit full debugging info for them. */ + +static void +retry_incomplete_types () +{ + register tree type; + + while (incomplete_types) + { + --incomplete_types; + type = incomplete_types_list[incomplete_types]; + gen_type_die (type, comp_unit_die); + } +} + /* Generate a DIE to represent an inlined instance of an enumeration type. */ static void @@ -9024,7 +9075,10 @@ gen_struct_or_union_type_die (type, context_die) } } else - add_AT_flag (type_die, DW_AT_declaration, 1); + { + add_AT_flag (type_die, DW_AT_declaration, 1); + add_incomplete_type (type); + } } /* Generate a DIE for a subroutine _type_. */ @@ -9993,6 +10047,10 @@ dwarf2out_finish () free (node); } + /* Walk through the list of incomplete types again, trying once more to + emit full debugging info for them. */ + retry_incomplete_types (); + /* Traverse the DIE tree and add sibling attributes to those DIE's that have children. */ add_sibling_attributes (comp_unit_die); diff --git a/gnu/egcs/gcc/expr.h b/gnu/egcs/gcc/expr.h index 1a6008a8f01..55e82e6622d 100644 --- a/gnu/egcs/gcc/expr.h +++ b/gnu/egcs/gcc/expr.h @@ -1015,6 +1015,14 @@ extern rtx (*lang_expand_expr) PROTO ((union tree_node *, rtx, enum machine_mode, enum expand_modifier modifier)); +#ifdef TREE_CODE +/* Hook called by output_constant for language-specific tree codes. + It is up to the language front-end to install a hook if it has any + such codes that output_constant needs to know about. Returns a + language-independent constant equivalent to its input. */ +extern tree (*lang_expand_constant) PROTO((tree)); +#endif + extern void init_all_optabs PROTO ((void)); extern void init_mov_optab PROTO ((void)); extern void do_jump_by_parts_equality_rtx PROTO((rtx, rtx, rtx)); diff --git a/gnu/egcs/gcc/fixproto b/gnu/egcs/gcc/fixproto index 03c8fddb435..9e022113ea0 100644 --- a/gnu/egcs/gcc/fixproto +++ b/gnu/egcs/gcc/fixproto @@ -54,12 +54,27 @@ # Ron Guilmette (rfg@netcom.com) (original idea and code) # Per Bothner (bothner@cygnus.com) (major re-write) -progname=$0 -progname=`basename $progname` +dirname=`echo "$0" | sed 's,^[^/]*$,.,;s,//*[^/]*$,,'` +progname=`echo "$0" | sed 's,.*/,,'` original_dir=`pwd` FIX_HEADER=${FIX_HEADER-$original_dir/fix-header} DEFINES="-D__STDC__=0 -D__cplusplus ${FIXPROTO_DEFINES}" +if mkdir -p . 2> /dev/null; then + # Great, mkdir accepts -p + mkinstalldirs="mkdir -p" +else + # We expect mkinstalldirs to be passed in the environment. + # If it is not, assume it is in the directory that contains this script. + mkinstalldirs=${mkinstalldirs-"/bin/sh $dirname/mkinstalldirs"} + if $mkinstalldirs . 2> /dev/null; then + : + else + # But, in case of failure, fallback to plain mkdir, and hope it works + mkinstalldirs=mkdir + fi +fi + if [ `echo $1 | wc -w` = 0 ] ; then echo $progname\: usage\: $progname target-dir \[ source-dir \.\.\. \] exit 1 @@ -94,7 +109,7 @@ fi if [ \! -d $abs_target_dir ] ; then echo $progname\: creating directory $rel_target_dir - mkdir -p $abs_target_dir + $mkinstalldirs $abs_target_dir fi echo $progname\: populating \`$rel_target_dir\' @@ -175,7 +190,7 @@ for code in ALL STD ; do abs_target_subdir=${abs_target_dir}/${rel_source_subdir} if [ \! -d $abs_target_subdir ] ; then - if mkdir -p $abs_target_subdir ; then + if $mkinstalldirs $abs_target_subdir ; then subdirs_made="$abs_target_subdir $subdirs_made" fi fi @@ -202,7 +217,7 @@ for code in ALL STD ; do # Create the dir where this file will go when fixed. xxdir=`echo ./$file | sed -e 's|/[^/]*$||'` if [ \! -d $abs_target_subdir/$xxdir ] ; then - if mkdir -p $abs_target_subdir/$xxdir ; then + if $mkinstalldirs $abs_target_subdir/$xxdir ; then subdirs_made="$abs_target_subdir/$xxdir $subdirs_made" fi fi diff --git a/gnu/egcs/gcc/flow.c b/gnu/egcs/gcc/flow.c index b46c87ea46a..8b0a7691aa1 100644 --- a/gnu/egcs/gcc/flow.c +++ b/gnu/egcs/gcc/flow.c @@ -2272,11 +2272,14 @@ mark_regs_live_at_end (set) we end up eliminating it, it will be removed from the live list of each basic block by reload. */ - SET_REGNO_REG_SET (set, FRAME_POINTER_REGNUM); + if (! reload_completed || frame_pointer_needed) + { + SET_REGNO_REG_SET (set, FRAME_POINTER_REGNUM); #if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM - /* If they are different, also mark the hard frame pointer as live */ - SET_REGNO_REG_SET (set, HARD_FRAME_POINTER_REGNUM); + /* If they are different, also mark the hard frame pointer as live */ + SET_REGNO_REG_SET (set, HARD_FRAME_POINTER_REGNUM); #endif + } /* Mark all global registers, and all registers used by the epilogue as being live at the end of the function since they may be @@ -2957,9 +2960,11 @@ insn_dead_p (x, needed, call_ok, notes) /* Don't delete insns to set global regs. */ if ((regno < FIRST_PSEUDO_REGISTER && global_regs[regno]) /* Make sure insns to set frame pointer aren't deleted. */ - || regno == FRAME_POINTER_REGNUM + || (regno == FRAME_POINTER_REGNUM + && (! reload_completed || frame_pointer_needed)) #if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM - || regno == HARD_FRAME_POINTER_REGNUM + || (regno == HARD_FRAME_POINTER_REGNUM + && (! reload_completed || frame_pointer_needed)) #endif #if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM /* Make sure insns to set arg pointer are never deleted @@ -3258,6 +3263,9 @@ mark_set_1 (needed, dead, x, insn, significant) invalidate_mems_from_autoinc (insn); if (GET_CODE (reg) == MEM && ! side_effects_p (reg) + /* We do not know the size of a BLKmode store, so we do not track + them for redundant store elimination. */ + && GET_MODE (reg) != BLKmode /* There are no REG_INC notes for SP, so we can't assume we'll see everything that invalidates it. To be safe, don't eliminate any stores though SP; none of them should be redundant anyway. */ @@ -3265,9 +3273,11 @@ mark_set_1 (needed, dead, x, insn, significant) mem_set_list = gen_rtx_EXPR_LIST (VOIDmode, reg, mem_set_list); if (GET_CODE (reg) == REG - && (regno = REGNO (reg), regno != FRAME_POINTER_REGNUM) + && (regno = REGNO (reg), ! (regno == FRAME_POINTER_REGNUM + && (! reload_completed || frame_pointer_needed))) #if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM - && regno != HARD_FRAME_POINTER_REGNUM + && ! (regno == HARD_FRAME_POINTER_REGNUM + && (! reload_completed || frame_pointer_needed)) #endif #if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM && ! (regno == ARG_POINTER_REGNUM && fixed_regs[regno]) @@ -3725,12 +3735,14 @@ mark_used_regs (needed, live, x, final, insn) nothing below can be necessary, so waste no more time. */ if (regno == STACK_POINTER_REGNUM #if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM - || regno == HARD_FRAME_POINTER_REGNUM + || (regno == HARD_FRAME_POINTER_REGNUM + && (! reload_completed || frame_pointer_needed)) #endif #if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM || (regno == ARG_POINTER_REGNUM && fixed_regs[regno]) #endif - || regno == FRAME_POINTER_REGNUM) + || (regno == FRAME_POINTER_REGNUM + && (! reload_completed || frame_pointer_needed))) { /* If this is a register we are going to try to eliminate, don't mark it live here. If we are successful in @@ -3906,9 +3918,11 @@ mark_used_regs (needed, live, x, final, insn) if ((GET_CODE (testreg) == PARALLEL && GET_MODE (testreg) == BLKmode) || (GET_CODE (testreg) == REG - && (regno = REGNO (testreg), regno != FRAME_POINTER_REGNUM) + && (regno = REGNO (testreg), ! (regno == FRAME_POINTER_REGNUM + && (! reload_completed || frame_pointer_needed))) #if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM - && regno != HARD_FRAME_POINTER_REGNUM + && ! (regno == HARD_FRAME_POINTER_REGNUM + && (! reload_completed || frame_pointer_needed)) #endif #if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM && ! (regno == ARG_POINTER_REGNUM && fixed_regs[regno]) diff --git a/gnu/egcs/gcc/function.h b/gnu/egcs/gcc/function.h index 878de9e950e..297c4f043c5 100644 --- a/gnu/egcs/gcc/function.h +++ b/gnu/egcs/gcc/function.h @@ -216,11 +216,40 @@ struct function /* The FUNCTION_DECL for an inline function currently being expanded. */ extern tree inline_function_decl; +/* Label that will go on parm cleanup code, if any. + Jumping to this label runs cleanup code for parameters, if + such code must be run. Following this code is the logical return label. */ + +extern rtx cleanup_label; + /* Label that will go on function epilogue. Jumping to this label serves as a "return" instruction on machines which require execution of the epilogue on all returns. */ + extern rtx return_label; +/* Offset to end of allocated area of stack frame. + If stack grows down, this is the address of the last stack slot allocated. + If stack grows up, this is the address for the next slot. */ +extern HOST_WIDE_INT frame_offset; + +/* Label to jump back to for tail recursion, or 0 if we have + not yet needed one for this function. */ +extern rtx tail_recursion_label; + +/* Place after which to insert the tail_recursion_label if we need one. */ +extern rtx tail_recursion_reentry; + +/* Location at which to save the argument pointer if it will need to be + referenced. There are two cases where this is done: if nonlocal gotos + exist, or if vars whose is an offset from the argument pointer will be + needed by inner routines. */ + +extern rtx arg_pointer_save_area; + +/* Chain of all RTL_EXPRs that have insns in them. */ +extern tree rtl_expr_chain; + /* List (chain of EXPR_LISTs) of all stack slots in this function. Made for the sake of unshare_all_rtl. */ extern rtx stack_slot_list; diff --git a/gnu/egcs/gcc/haifa-sched.c b/gnu/egcs/gcc/haifa-sched.c index a87c98a9444..41a61c459cd 100644 --- a/gnu/egcs/gcc/haifa-sched.c +++ b/gnu/egcs/gcc/haifa-sched.c @@ -4630,12 +4630,15 @@ attach_deaths (x, insn, set_p) if (regno >= FIRST_PSEUDO_REGISTER || ! global_regs[regno]) { - /* Never add REG_DEAD notes for the FRAME_POINTER_REGNUM or the - STACK_POINTER_REGNUM, since these are always considered to be - live. Similarly for ARG_POINTER_REGNUM if it is fixed. */ - if (regno != FRAME_POINTER_REGNUM + /* Never add REG_DEAD notes for STACK_POINTER_REGNUM + since it's always considered to be live. Similarly + for FRAME_POINTER_REGNUM if a frame pointer is needed + and for ARG_POINTER_REGNUM if it is fixed. */ + if (! (regno == FRAME_POINTER_REGNUM + && (! reload_completed || frame_pointer_needed)) #if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM - && ! (regno == HARD_FRAME_POINTER_REGNUM) + && ! (regno == HARD_FRAME_POINTER_REGNUM + && (! reload_completed || frame_pointer_needed)) #endif #if ARG_POINTER_REGNUM != FRAME_POINTER_REGNUM && ! (regno == ARG_POINTER_REGNUM && fixed_regs[regno]) |