1992-02-06 00:20:23 +01:00
/* Top level of GNU C compiler
2000-01-05 07:29:24 +01:00
Copyright ( C ) 1987 , 88 , 89 , 92 - 98 , 1999 , 2000 Free Software Foundation , Inc .
1992-02-06 00:20:23 +01:00
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
1995-06-15 14:29:51 +02:00
the Free Software Foundation , 59 Temple Place - Suite 330 ,
Boston , MA 02111 - 1307 , USA . */
1992-02-06 00:20:23 +01:00
/* This is the top level of cc1/c++.
It parses command args , opens files , invokes the various passes
in the proper order , and counts the time used by each .
Error messages and low - level interface to malloc also handled here . */
# include "config.h"
Major cutover to using system.h:
* Makefile.in (alias.o, bitmap.o, c-aux-info.o, c-common.o,
c-decl.o, c-iterate.o, c-lang.o, c-lex.o, c-pragma.o, c-typeck.o,
caller-save.o, calls.o, collect2.o, combine.o, cse.o, dbxout.o,
dwarf2out.o, dwarfout.o, emit-rtl.o, except.o, explow.o, expmed.o,
expr.o, final.o, flow.o, function.o, getpwd.o, global.o,
integrate.o, jump.o, local-alloc.o, loop.o, optabs.o, pexecute.o,
prefix.o, print-rtl.o, print-tree.o, profile.o, real.o, recog.o,
reg-stack.o, regclass.o, regmove.o, reload.o, reload1.o, reorg.o,
rtl.o, rtlanal.o, sdbout.o, stmt.o, stor-layout.o, stupid.o,
tlink.o, toplev.o, tree.o, unroll.o, varasm.o, xcoffout.o): Depend
on system.h.
* alias.c, bitmap.c, c-aux-info.c, c-common.c, c-decl.c,
c-iterate.c, c-lang.c, c-lex.c, c-pragma.c, c-typeck.c,
caller-save.c, calls.c, collect2.c, combine.c, cse.c, dbxout.c,
dwarf2out.c, dwarfout.c, emit-rtl.c, except.c, explow.c, expmed.c,
expr.c, final.c, flow.c, function.c, gcc.c, getpwd.c, global.c,
integrate.c, jump.c, local-alloc.c, loop.c, optabs.c, pexecute.c,
prefix.c, print-rtl.c, print-tree.c, profile.c, real.c, recog.c,
reg-stack.c, regclass.c, regmove.c, reload.c, reload1.c, reorg.c,
rtl.c, rtlanal.c, sched.c, sdbout.c, stmt.c, stor-layout.c,
stupid.c, tlink.c, toplev.c, tree.c, unroll.c, varasm.c,
xcoffout.c: Include system.h. Organize include ordering so
that stdarg/varargs comes before other system headers. Remove
spurious casts of functions assured of a prototype in system.h.
From-SVN: r18726
1998-03-20 15:58:42 +01:00
# undef FLOAT /* This is for hpux. They should change hpux. */
# undef FFS /* Some systems define this in param.h. */
# include "system.h"
1992-02-06 00:20:23 +01:00
# include <signal.h>
# include <setjmp.h>
1997-12-07 01:31:01 +01:00
# ifdef HAVE_SYS_RESOURCE_H
# include <sys / resource.h>
# endif
# ifdef HAVE_SYS_TIMES_H
# include <sys / times.h>
1994-09-30 22:29:38 +01:00
# endif
1992-02-06 00:20:23 +01:00
# include "input.h"
# include "tree.h"
# include "rtl.h"
1999-09-20 12:00:03 +02:00
# include "tm_p.h"
1992-02-06 00:20:23 +01:00
# include "flags.h"
# include "insn-attr.h"
1998-04-04 15:32:39 +02:00
# include "insn-codes.h"
# include "insn-config.h"
# include "recog.h"
1993-03-25 09:51:26 +01:00
# include "defaults.h"
1994-12-30 13:59:51 +01:00
# include "output.h"
1996-07-23 21:58:32 +02:00
# include "except.h"
1999-08-09 16:00:21 +02:00
# include "function.h"
toplev.h cleanups...
* toplev.c: Include toplev.h.
* Makefile.in (c-common.o, c-convert.o, c-decl.o, c-iterate.o,
c-lex.o, c-parse.o, c-pragma.o, c-typeck.o, calls.o, convert.o,
dwarf2out.o, except.o, expr.o, final.o, fold-const.o, function.o,
hash.o, profile.o, real.o, reg-stack.o, regclass.o, reload.o,
reload1.o, stmt.o, stor-layout.o, tlink.o, tree.o, varasm.o): Add
toplev.h dependency.
From-SVN: r19589
1998-05-06 18:43:15 +02:00
# include "toplev.h"
Makefile.in (toplev.o): Depend on $(EXPR_H).
* Makefile.in (toplev.o): Depend on $(EXPR_H).
(insn-extract.o, insn-attrtab.o): Depend on toplev.h.
* gansidecl.h: Define ATTRIBUTE_NORETURN.
* genattrtab.c: Have insn-attrtab.c include toplev.h.
* genextract.c: Have insn-extract.c include toplev.h.
* rtl.h: Don't prototype `fatal_insn_not_found' and `fatal_insn'.
* toplev.c: Include expr.h.
(really_sorry, fancy_abort): Remove prototypes.
(set_target_switch): Add argument in prototype.
(vfatal): Mark prototype with ATTRIBUTE_NORETURN.
(v_really_sorry): Likewise.
(print_version, print_single_switch, print_switch_values): Make
static and add prototype arguments.
(decl_printable_name): Add prototype arguments.
(lang_expand_expr_t): New typedef.
(lang_expand_expr): Declare as a lang_expand_expr_t.
(incomplete_decl_finalize_hook): Add prototype argument.
(decl_name): Mark variable `verbosity' with ATTRIBUTE_UNUSED.
(botch): Likewise for variable `s'.
(rest_of_type_compilation): Mark variables `type' and `toplev'
with ATTRIBUTE_UNUSED if none of DBX_DEBUGGING_INFO,
XCOFF_DEBUGGING_INFO or SDB_DEBUGGING_INFO are defined.
(display_help): Make variable `i' an `unsigned long'.
(main): Remove unused parameter `envp'.
Cast assignment to `lang_expand_expr' to a `lang_expand_expr_t'.
Cast -1 when comparing it with a `size_t'.
* toplev.h (fatal, fatal_io_error, pfatal_with_name): Mark
prototype with ATTRIBUTE_NORETURN.
(fatal_insn_not_found, fatal_insn, really_sorry,
push_float_handler, pop_float_handler): Add prototypes.
(fancy_abort): Mark prototype with ATTRIBUTE_NORETURN.
(do_abort, botch): Add prototypes.
From-SVN: r22293
1998-09-06 07:56:20 +02:00
# include "expr.h"
1999-03-09 07:40:49 +01:00
# include "basic-block.h"
1999-01-27 02:43:17 +01:00
# include "intl.h"
1999-09-04 20:25:41 +02:00
# include "ggc.h"
1999-10-02 22:13:24 +02:00
# include "graph.h"
Makefile.in (toplev.o): Depend on loop.h.
* Makefile.in (toplev.o): Depend on loop.h.
* dwarfout.c: Include tm_p.h.
* emit-rtl.c (restore_emit_status): Mark parameter with
ATTRIBUTE_UNUSED.
* final.c (final_scan_insn): Likewise.
* flow.c (flow_nodes_print, flow_exits_print, flow_loops_cfg_dump,
flow_loop_nested_p, flow_loop_exits_find, flow_loop_nodes_find,
flow_depth_first_order_compute, flow_loop_pre_header_find,
flow_loop_tree_node_add, flow_loops_tree_build,
flow_loop_level_compute, flow_loops_level_compute,
flow_loop_outside_edge_p): Add prototypes.
(recompute_reg_usage): Mark parameters with ATTRIBUTE_UNUSED.
* ggc-callbacks.c (lang_mark_tree, lang_mark_false_label_stack):
Mark with ATTRIBUTE_NORETURN.
* hash.c (hash_newfunc): Mark parameter with ATTRIBUTE_UNUSED.
* local-alloc.c (no_conflict_p): Likewise.
* loop.c (insert_bct): Hide definitions of variables with hidden
usage.
(note_reg_stored): Mark parameter with ATTRIBUTE_UNUSED.
* regclass.c (memory_move_secondary_cost): Mark variable `mem'
with ATTRIBUTE_UNUSED.
(record_reg_classes): Mark parameter with ATTRIBUTE_UNUSED.
(reg_scan): Likewise.
* reload.c (find_reloads): Remove unused variables `changed'.
* reload1.c (reload_reg_class_lower): Don't unnecessarily cast
away const-ness.
(allocate_reload_reg): Mark parameter with ATTRIBUTE_UNUSED.
Remove unused variable `insn'.
* toplev.c: Include loop.h.
(report_file_and_line): Remove unnecessary prototype.
* tree.c (build_block): Mark parameter with ATTRIBUTE_UNUSED.
* unroll.c (biv_total_increment): Likewise.
From-SVN: r31085
1999-12-24 15:04:54 +01:00
# include "loop.h"
2000-01-11 23:57:39 +01:00
# include "regs.h"
1992-03-23 20:29:32 +01:00
dwarfout.h, [...]: New files.
* dwarfout.h, dwarf2out.h, dbxout.h, sdbout.h: New files.
Prototypes for externally used functions in respective C files.
* dwarfout.c, dbxout.c, dwarf2out.c, sdbout.c, toplev,c,
final.c: Include above files.
* Makefile.in (toplev.o): Add dependency for above four headers.
(final.o): Likewise.
(dwarfout.o, dbxout.o, dwarf2out.o, sdbout.o): Depend on four
respective header files.
From-SVN: r19835
1998-05-18 09:11:42 +02:00
# ifdef DWARF_DEBUGGING_INFO
# include "dwarfout.h"
# endif
# if defined (DWARF2_UNWIND_INFO) || defined (DWARF2_DEBUGGING_INFO)
# include "dwarf2out.h"
# endif
1998-06-29 19:36:07 +02:00
# if defined(DBX_DEBUGGING_INFO) || defined(XCOFF_DEBUGGING_INFO)
dwarfout.h, [...]: New files.
* dwarfout.h, dwarf2out.h, dbxout.h, sdbout.h: New files.
Prototypes for externally used functions in respective C files.
* dwarfout.c, dbxout.c, dwarf2out.c, sdbout.c, toplev,c,
final.c: Include above files.
* Makefile.in (toplev.o): Add dependency for above four headers.
(final.o): Likewise.
(dwarfout.o, dbxout.o, dwarf2out.o, sdbout.o): Depend on four
respective header files.
From-SVN: r19835
1998-05-18 09:11:42 +02:00
# include "dbxout.h"
# endif
# ifdef SDB_DEBUGGING_INFO
# include "sdbout.h"
# endif
1992-03-23 20:29:32 +01:00
# ifdef XCOFF_DEBUGGING_INFO
# include "xcoffout.h"
# endif
1992-02-06 00:20:23 +01:00
# ifdef VMS
/* The extra parameters substantially improve the I/O performance. */
static FILE *
1994-12-12 14:04:24 +01:00
vms_fopen ( fname , type )
1992-02-06 00:20:23 +01:00
char * fname ;
char * type ;
{
1994-12-12 14:04:24 +01:00
/* The <stdio.h> in the gcc-vms-1.42 distribution prototypes fopen with two
fixed arguments , which matches ANSI ' s specification but not VAXCRTL ' s
pre - ANSI implementation . This hack circumvents the mismatch problem . */
FILE * ( * vmslib_fopen ) ( ) = ( FILE * ( * ) ( ) ) fopen ;
if ( * type = = ' w ' )
return ( * vmslib_fopen ) ( fname , type , " mbc=32 " ,
" deq=64 " , " fop=tef " , " shr=nil " ) ;
else
return ( * vmslib_fopen ) ( fname , type , " mbc=32 " ) ;
1992-02-06 00:20:23 +01:00
}
1994-12-12 14:04:24 +01:00
# define fopen vms_fopen
# endif /* VMS */
1992-02-06 00:20:23 +01:00
# ifndef DEFAULT_GDB_EXTENSIONS
# define DEFAULT_GDB_EXTENSIONS 1
# endif
1996-09-24 13:28:50 +02:00
/* If more than one debugging type is supported, you must define
PREFERRED_DEBUGGING_TYPE to choose a format in a system - dependent way .
This is one long line cause VAXC can ' t handle a \ - newline . */
1996-11-15 08:14:08 +01:00
# if 1 < (defined (DBX_DEBUGGING_INFO) + defined (SDB_DEBUGGING_INFO) + defined (DWARF_DEBUGGING_INFO) + defined (DWARF2_DEBUGGING_INFO) + defined (XCOFF_DEBUGGING_INFO))
1996-09-24 13:28:50 +02:00
# ifndef PREFERRED_DEBUGGING_TYPE
You Lose ! You must define PREFERRED_DEBUGGING_TYPE !
# endif /* no PREFERRED_DEBUGGING_TYPE */
# else / * Only one debugging format supported. Define PREFERRED_DEBUGGING_TYPE
so the following code needn ' t care . */
# ifdef DBX_DEBUGGING_INFO
# define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
# endif
# ifdef SDB_DEBUGGING_INFO
# define PREFERRED_DEBUGGING_TYPE SDB_DEBUG
# endif
# ifdef DWARF_DEBUGGING_INFO
# define PREFERRED_DEBUGGING_TYPE DWARF_DEBUG
# endif
1996-11-15 08:14:08 +01:00
# ifdef DWARF2_DEBUGGING_INFO
# define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
# endif
1996-09-24 13:28:50 +02:00
# ifdef XCOFF_DEBUGGING_INFO
# define PREFERRED_DEBUGGING_TYPE XCOFF_DEBUG
# endif
# endif /* More than one debugger format enabled. */
/* If still not defined, must have been because no debugging formats
are supported . */
# ifndef PREFERRED_DEBUGGING_TYPE
# define PREFERRED_DEBUGGING_TYPE NO_DEBUG
# endif
configure.in (i?86-*-beos{pe,elf,}*): Recognize.
* configure.in (i?86-*-beos{pe,elf,}*): Recognize.
* i386/t-beos, i386/x-beos, i386/xm-beos.h: New files.
* i386/beos-elf.h, i386/beos-pe.h: New files.
* Makefile.in (CROSS_SYSTEM_HEADER_DIR): New.
* cross-make (SYSTEM_HEADER_DIR): Define using
CROSS_SYSTEM_HEADER_DIR.
* gcc.c (LIBRARY_PATH_ENV): Provide default.
(process_command): Use it.
(main): Likewise. Kill trailing = from env vars.
(build_search_list): Put it back.
* collect2.c (main): Use LIBRARY_PATH_ENV.
* configure.in (GCC_NEED_DECLARATIONS): Add environ.
* toplev.c: Use NEED_DECLARATION_ENVIRON.
* tm.texi (Frame Layout): Document SMALL_STACK.
* c-common.c (c_common_nodes_and_builtins): Check it.
* system.h: Undef alloca after including glibc's <stdlib.h>,
if USE_C_ALLOCA is defined.
* gcc.c (set_input): New fn.
(main): After all input files are compiled, reset the input file
info to the first.
* aclocal.m4 (rindex, index): If already defined, don't attempt
to redefine.
* ginclude/varargs.h: (__va_list__): Define ifndef.
* ginclude/stdarg.h: Likewise.
* ginclude/stddef.h (__WCHAR_TYPE__) [BEOS]: Use int
instead of unsigned char.
* hash.h (true, false, boolean): Undef before enum.
From-SVN: r31366
2000-01-13 01:37:06 +01:00
# ifdef NEED_DECLARATION_ENVIRON
1992-02-06 00:20:23 +01:00
extern char * * environ ;
1992-08-20 21:32:37 +02:00
# endif
1999-08-31 04:16:34 +02:00
extern char * version_string ;
1992-02-06 00:20:23 +01:00
1993-10-20 20:51:14 +01:00
/* Carry information from ASM_DECLARE_OBJECT_NAME
to ASM_FINISH_DECLARE_OBJECT . */
extern int size_directive_output ;
1993-10-24 08:06:49 +01:00
extern tree last_assemble_variable_decl ;
1993-10-20 20:51:14 +01:00
2000-01-17 16:55:18 +01:00
static void set_target_switch PARAMS ( ( const char * ) ) ;
static const char * decl_name PARAMS ( ( tree , int ) ) ;
toplev.c (notice, [...]): Move to diagnostic.c
1999-12-18 Gabriel Dos Reis <gdr@codesourcery.com>
* toplev.c (notice, vmessage, v_message_with_file_and_line,
v_message_with_decl, file_and_line_for_asm,
v_error_with_file_and_line, v_error_with_decl, v_error_for_asm,
verror, vfatal, v_warning_with_file_and_line, v_warning_with_decl,
v_warning_for_asm, vwarning, vpedwarn, v_pedwarn_with_decl,
v_pedwarn_with_file_and_line, vsorry, vnotice, count_error,
pfatal_with_name, fatal_io_error, need_error_newline,
last_error_function, last_error_tick, announce_function,
default_print_error_function, print_error_function,
report_error_function, fnotice, error_with_file_and_line,
error_with_decl, error_for_asm, error, set_fatal_function, fatal,
_fatal_insn, _fatal_insn_not_found, warning_with_file_and_line,
warning_with_decl, warning_for_asm, warning, pedwarn,
pedwarn_with_decl, pedwarn_with_file_and_line, sorry): Move to
diagnostic.c
(compile_file): Use fnotice instead of notice. Adjust call.
* diagnostic.c: New file.
* Makefile.in (OBJS): Include diagnostic.o
(diagnostic.o): Define dependence.
From-SVN: r31003
1999-12-18 02:45:40 +01:00
2000-01-17 16:55:18 +01:00
extern void set_fatal_function PARAMS ( ( void ( * ) ( const char * , va_list ) ) ) ;
static void float_signal PARAMS ( ( int ) ) ATTRIBUTE_NORETURN ;
static void pipe_closed PARAMS ( ( int ) ) ATTRIBUTE_NORETURN ;
1998-11-04 23:49:18 +01:00
# ifdef ASM_IDENTIFY_LANGUAGE
1999-01-18 07:17:31 +01:00
/* This might or might not be used in ASM_IDENTIFY_LANGUAGE. */
2000-01-17 16:55:18 +01:00
static void output_lang_identify PARAMS ( ( FILE * ) ) ATTRIBUTE_UNUSED ;
1998-11-04 23:49:18 +01:00
# endif
2000-01-17 16:55:18 +01:00
static void open_dump_file PARAMS ( ( const char * , const char * ) ) ;
static void close_dump_file PARAMS ( ( void ( * ) ( FILE * , rtx ) , rtx ) ) ;
static void dump_rtl PARAMS ( ( const char * , tree , void ( * ) ( FILE * , rtx ) , rtx ) ) ;
static void clean_dump_file PARAMS ( ( const char * ) ) ;
static void compile_file PARAMS ( ( char * ) ) ;
static void display_help PARAMS ( ( void ) ) ;
static void mark_file_stack PARAMS ( ( void * ) ) ;
static void decode_d_option PARAMS ( ( const char * ) ) ;
static int decode_f_option PARAMS ( ( const char * ) ) ;
static int decode_W_option PARAMS ( ( const char * ) ) ;
static int decode_g_option PARAMS ( ( const char * ) ) ;
static unsigned independent_decode_option PARAMS ( ( int , char * * , unsigned ) ) ;
static void print_version PARAMS ( ( FILE * , const char * ) ) ;
static int print_single_switch PARAMS ( ( FILE * , int , int , const char * ,
cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
* cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
Instead of writing to const char *buf directly, use a non-const
variable `wbuf' to allocate and write a string, then set buf = wbuf.
* cppulp.c (user_label_prefix): Qualify a char* with the `const'
keyword.
* dyn-string.c (dyn_string_append): Likewise.
* dyn-string.h (dyn_string_append): Likewise.
* final.c (end_final, output_operand_lossage, asm_fprintf): Likewise.
* output.h (end_final, output_operand_lossage, asm_fprintf,
named_section, decode_reg_name, make_decl_rtl, user_label_prefix):
Likewise.
* profile.c (init_branch_prob): Likewise.
* toplev.c (set_target_switch, vmessage,
v_message_with_file_and_line, v_message_with_decl,
v_error_with_file_and_line, v_error_with_decl, v_error_for_asm,
verror, vfatal, v_warning_with_file_and_line, v_warning_with_decl,
v_warning_for_asm, vwarning, vpedwarn, v_pedwarn_with_decl,
v_pedwarn_with_file_and_line, vsorry, v_really_sorry,
open_dump_file, dump_rtl, clean_dump_file,
print_version, print_single_switch, print_switch_values,
dump_base_name, debug_args, lang_independent_options,
user_label_prefix, documented_lang_options, target_switches,
target_options, print_time, pfatal_with_name, fatal_io_error,
fatal_insn, default_print_error_function, print_error_function,
report_error_function, error_with_file_and_line, error_with_decl,
error_for_asm, error, fatal, warning_with_file_and_line,
warning_with_decl, warning_for_asm, warning, pedwarn,
pedwarn_with_decl, pedwarn_with_file_and_line, sorry,
really_sorry, botch, output_quoted_string, output_file_directive,
open_dump_file, rest_of_decl_compilation, display_help, main):
Likewise.
* toplev.h (print_time, fatal, fatal_io_error, pfatal_with_name,
fatal_insn, warning, error, pedwarn, pedwarn_with_file_and_line,
warning_with_file_and_line, error_with_file_and_line, sorry,
really_sorry, default_print_error_function, report_error_function,
rest_of_decl_compilation, pedwarn_with_decl, warning_with_decl,
error_with_decl, error_for_asm, warning_for_asm, output_quoted_string,
output_file_directive, botch): Likewise.
* tree.h (make_decl_rtl): Likewise.
* varasm.c (strip_reg_name, named_section, decode_reg_name,
make_decl_rtl): Likewise.
From-SVN: r24743
1999-01-18 09:53:41 +01:00
const char * , const char * ,
const char * , const char * ) ) ;
2000-01-17 16:55:18 +01:00
static void print_switch_values PARAMS ( ( FILE * , int , int , const char * ,
cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
* cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
Instead of writing to const char *buf directly, use a non-const
variable `wbuf' to allocate and write a string, then set buf = wbuf.
* cppulp.c (user_label_prefix): Qualify a char* with the `const'
keyword.
* dyn-string.c (dyn_string_append): Likewise.
* dyn-string.h (dyn_string_append): Likewise.
* final.c (end_final, output_operand_lossage, asm_fprintf): Likewise.
* output.h (end_final, output_operand_lossage, asm_fprintf,
named_section, decode_reg_name, make_decl_rtl, user_label_prefix):
Likewise.
* profile.c (init_branch_prob): Likewise.
* toplev.c (set_target_switch, vmessage,
v_message_with_file_and_line, v_message_with_decl,
v_error_with_file_and_line, v_error_with_decl, v_error_for_asm,
verror, vfatal, v_warning_with_file_and_line, v_warning_with_decl,
v_warning_for_asm, vwarning, vpedwarn, v_pedwarn_with_decl,
v_pedwarn_with_file_and_line, vsorry, v_really_sorry,
open_dump_file, dump_rtl, clean_dump_file,
print_version, print_single_switch, print_switch_values,
dump_base_name, debug_args, lang_independent_options,
user_label_prefix, documented_lang_options, target_switches,
target_options, print_time, pfatal_with_name, fatal_io_error,
fatal_insn, default_print_error_function, print_error_function,
report_error_function, error_with_file_and_line, error_with_decl,
error_for_asm, error, fatal, warning_with_file_and_line,
warning_with_decl, warning_for_asm, warning, pedwarn,
pedwarn_with_decl, pedwarn_with_file_and_line, sorry,
really_sorry, botch, output_quoted_string, output_file_directive,
open_dump_file, rest_of_decl_compilation, display_help, main):
Likewise.
* toplev.h (print_time, fatal, fatal_io_error, pfatal_with_name,
fatal_insn, warning, error, pedwarn, pedwarn_with_file_and_line,
warning_with_file_and_line, error_with_file_and_line, sorry,
really_sorry, default_print_error_function, report_error_function,
rest_of_decl_compilation, pedwarn_with_decl, warning_with_decl,
error_with_decl, error_for_asm, warning_for_asm, output_quoted_string,
output_file_directive, botch): Likewise.
* tree.h (make_decl_rtl): Likewise.
* varasm.c (strip_reg_name, named_section, decode_reg_name,
make_decl_rtl): Likewise.
From-SVN: r24743
1999-01-18 09:53:41 +01:00
const char * , const char * ) ) ;
1998-11-23 17:41:12 +01:00
1996-05-17 18:36:13 +02:00
/* Length of line when printing switch values. */
# define MAX_LINE 75
1992-02-06 00:20:23 +01:00
/* Name of program invoked, sans directories. */
rtl.h (get_insn_name, [...]): Add prototypes.
* rtl.h (get_insn_name, print_rtl_with_bb): Add prototypes.
* print-rtl.c (get_insn_name): Remove prototype.
* toplev.h (progname): Declare const.
* toplev.c (init_decl_processing, init_obstacks, init_tree_codes,
init_regs, init_optabs, init_stmt, init_reg_sets, dump_flow_info,
dump_sched_info, dump_local_alloc, regset_release_memory,
print_rtl, print_rtl_with_bb, rest_of_decl_compilation,
error_with_file_and_line, error_with_decl, error_for_asm, error,
fatal, warning_with_file_and_line, warning_with_decl, warning,
pedwarn, pedwarn_with_decl, pedwarn_with_file_and_line, sorry):
Remove redundant prototypes.
(notice, check_lang_option, report_file_and_line, vnotice,
mark_file_stack): Add static prototype.
(set_fatal_function): Add prototype.
(vnotice, report_file_and_line, set_fatal_function,
check_lang_option): Constify a char*.
(main): Prototype. Call return, not exit.
cp:
* typeck2.c (ack): Don't declare progname.
From-SVN: r29433
1999-09-15 16:04:10 +02:00
const char * progname ;
1992-02-06 00:20:23 +01:00
/* Copy of arguments to main. */
int save_argc ;
char * * save_argv ;
/* Name of current original source file (what was input to cpp).
This comes from each # - command in the actual input . */
char * input_filename ;
/* Name of top-level original source file (what was input to cpp).
This comes from the # - command at the beginning of the actual input .
If there isn ' t any there , then this is the cc1 input file name . */
char * main_input_filename ;
/* Current line number in real source file. */
int lineno ;
1998-11-25 11:31:24 +01:00
/* Nonzero if it is unsafe to create any new pseudo registers. */
int no_new_pseudos ;
1992-02-06 00:20:23 +01:00
/* Stack of currently pending input files. */
struct file_stack * input_file_stack ;
/* Incremented on each change to input_file_stack. */
int input_file_stack_tick ;
/* Name to use as base of names for dump output files. */
cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
* cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
Instead of writing to const char *buf directly, use a non-const
variable `wbuf' to allocate and write a string, then set buf = wbuf.
* cppulp.c (user_label_prefix): Qualify a char* with the `const'
keyword.
* dyn-string.c (dyn_string_append): Likewise.
* dyn-string.h (dyn_string_append): Likewise.
* final.c (end_final, output_operand_lossage, asm_fprintf): Likewise.
* output.h (end_final, output_operand_lossage, asm_fprintf,
named_section, decode_reg_name, make_decl_rtl, user_label_prefix):
Likewise.
* profile.c (init_branch_prob): Likewise.
* toplev.c (set_target_switch, vmessage,
v_message_with_file_and_line, v_message_with_decl,
v_error_with_file_and_line, v_error_with_decl, v_error_for_asm,
verror, vfatal, v_warning_with_file_and_line, v_warning_with_decl,
v_warning_for_asm, vwarning, vpedwarn, v_pedwarn_with_decl,
v_pedwarn_with_file_and_line, vsorry, v_really_sorry,
open_dump_file, dump_rtl, clean_dump_file,
print_version, print_single_switch, print_switch_values,
dump_base_name, debug_args, lang_independent_options,
user_label_prefix, documented_lang_options, target_switches,
target_options, print_time, pfatal_with_name, fatal_io_error,
fatal_insn, default_print_error_function, print_error_function,
report_error_function, error_with_file_and_line, error_with_decl,
error_for_asm, error, fatal, warning_with_file_and_line,
warning_with_decl, warning_for_asm, warning, pedwarn,
pedwarn_with_decl, pedwarn_with_file_and_line, sorry,
really_sorry, botch, output_quoted_string, output_file_directive,
open_dump_file, rest_of_decl_compilation, display_help, main):
Likewise.
* toplev.h (print_time, fatal, fatal_io_error, pfatal_with_name,
fatal_insn, warning, error, pedwarn, pedwarn_with_file_and_line,
warning_with_file_and_line, error_with_file_and_line, sorry,
really_sorry, default_print_error_function, report_error_function,
rest_of_decl_compilation, pedwarn_with_decl, warning_with_decl,
error_with_decl, error_for_asm, warning_for_asm, output_quoted_string,
output_file_directive, botch): Likewise.
* tree.h (make_decl_rtl): Likewise.
* varasm.c (strip_reg_name, named_section, decode_reg_name,
make_decl_rtl): Likewise.
From-SVN: r24743
1999-01-18 09:53:41 +01:00
const char * dump_base_name ;
1992-02-06 00:20:23 +01:00
/* Bit flags that specify the machine subtype we are compiling for.
Bits are tested using macros TARGET_ . . . defined in the tm . h file
and set by ` - m . . . ' switches . Must be defined in rtlanal . c . */
extern int target_flags ;
/* Flags saying which kinds of debugging dump have been requested. */
int rtl_dump = 0 ;
int rtl_dump_and_exit = 0 ;
int jump_opt_dump = 0 ;
1997-11-02 22:19:36 +01:00
int addressof_dump = 0 ;
1992-02-06 00:20:23 +01:00
int cse_dump = 0 ;
1998-05-20 02:24:32 +02:00
int gcse_dump = 0 ;
1992-02-06 00:20:23 +01:00
int loop_dump = 0 ;
int cse2_dump = 0 ;
1997-03-28 23:40:07 +01:00
int branch_prob_dump = 0 ;
1992-02-06 00:20:23 +01:00
int flow_dump = 0 ;
int combine_dump = 0 ;
1997-08-12 06:07:19 +02:00
int regmove_dump = 0 ;
1992-02-06 00:20:23 +01:00
int sched_dump = 0 ;
int local_reg_dump = 0 ;
int global_reg_dump = 0 ;
1999-02-26 00:45:42 +01:00
int flow2_dump = 0 ;
1999-08-31 22:37:09 +02:00
int peephole2_dump = 0 ;
1992-02-06 00:20:23 +01:00
int sched2_dump = 0 ;
int jump2_opt_dump = 0 ;
1998-03-03 11:06:54 +01:00
# ifdef DELAY_SLOTS
1992-02-06 00:20:23 +01:00
int dbr_sched_dump = 0 ;
1998-03-03 11:06:54 +01:00
# endif
1992-02-06 00:20:23 +01:00
int flag_print_asm_name = 0 ;
1998-01-26 23:48:32 +01:00
# ifdef STACK_REGS
1992-02-06 00:20:23 +01:00
int stack_reg_dump = 0 ;
1998-01-26 23:48:32 +01:00
# endif
# ifdef MACHINE_DEPENDENT_REORG
int mach_dep_reorg_dump = 0 ;
# endif
1999-09-20 15:48:12 +02:00
static int flag_print_mem = 0 ;
static int version_flag = 0 ;
static char * filename = 0 ;
1998-11-23 17:41:12 +01:00
enum graph_dump_types graph_dump_format ;
1992-02-06 00:20:23 +01:00
/* Name for output file of assembly code, specified with -o. */
char * asm_file_name ;
/* Value of the -G xx switch, and whether it was passed or not. */
int g_switch_value ;
int g_switch_set ;
/* Type(s) of debugging information we are producing (if any).
See flags . h for the definitions of the different possible
types of debugging information . */
enum debug_info_type write_symbols = NO_DEBUG ;
/* Level of debugging information we are producing. See flags.h
for the definitions of the different possible levels . */
enum debug_info_level debug_info_level = DINFO_LEVEL_NONE ;
1992-07-05 01:29:58 +02:00
/* Nonzero means use GNU-only extensions in the generated symbolic
debugging information . */
/* Currently, this only has an effect when write_symbols is set to
DBX_DEBUG , XCOFF_DEBUG , or DWARF_DEBUG . */
int use_gnu_debug_info_extensions = 0 ;
1992-02-06 00:20:23 +01:00
/* Nonzero means do optimizations. -O.
Particular numeric values stand for particular amounts of optimization ;
thus , - O2 stores 2 here . However , the optimizations beyond the basic
ones are not controlled directly by this variable . Instead , they are
controlled by individual ` flag_ . . . ' variables that are defaulted
based on this variable . */
int optimize = 0 ;
1998-01-27 00:00:04 +01:00
/* Nonzero means optimize for size. -Os.
The only valid values are zero and non - zero . When optimize_size is
non - zero , optimize defaults to 2 , but certain individual code
bloating optimizations are disabled . */
int optimize_size = 0 ;
1992-02-06 00:20:23 +01:00
/* Number of error messages and warning messages so far. */
int errorcount = 0 ;
int warningcount = 0 ;
int sorrycount = 0 ;
1997-02-16 11:05:43 +01:00
/* Pointer to function to compute the name to use to print a declaration.
DECL is the declaration in question .
VERBOSITY determines what information will be printed :
0 : DECL_NAME , demangled as necessary .
1 : and scope information .
2 : and any other information that might be interesting , such as function
parameter types in C + + . */
1992-02-06 00:20:23 +01:00
2000-01-17 16:55:18 +01:00
const char * ( * decl_printable_name ) PARAMS ( ( tree , int ) ) ;
1992-02-06 00:20:23 +01:00
/* Pointer to function to compute rtl for a language-specific tree code. */
Makefile.in (toplev.o): Depend on $(EXPR_H).
* Makefile.in (toplev.o): Depend on $(EXPR_H).
(insn-extract.o, insn-attrtab.o): Depend on toplev.h.
* gansidecl.h: Define ATTRIBUTE_NORETURN.
* genattrtab.c: Have insn-attrtab.c include toplev.h.
* genextract.c: Have insn-extract.c include toplev.h.
* rtl.h: Don't prototype `fatal_insn_not_found' and `fatal_insn'.
* toplev.c: Include expr.h.
(really_sorry, fancy_abort): Remove prototypes.
(set_target_switch): Add argument in prototype.
(vfatal): Mark prototype with ATTRIBUTE_NORETURN.
(v_really_sorry): Likewise.
(print_version, print_single_switch, print_switch_values): Make
static and add prototype arguments.
(decl_printable_name): Add prototype arguments.
(lang_expand_expr_t): New typedef.
(lang_expand_expr): Declare as a lang_expand_expr_t.
(incomplete_decl_finalize_hook): Add prototype argument.
(decl_name): Mark variable `verbosity' with ATTRIBUTE_UNUSED.
(botch): Likewise for variable `s'.
(rest_of_type_compilation): Mark variables `type' and `toplev'
with ATTRIBUTE_UNUSED if none of DBX_DEBUGGING_INFO,
XCOFF_DEBUGGING_INFO or SDB_DEBUGGING_INFO are defined.
(display_help): Make variable `i' an `unsigned long'.
(main): Remove unused parameter `envp'.
Cast assignment to `lang_expand_expr' to a `lang_expand_expr_t'.
Cast -1 when comparing it with a `size_t'.
* toplev.h (fatal, fatal_io_error, pfatal_with_name): Mark
prototype with ATTRIBUTE_NORETURN.
(fatal_insn_not_found, fatal_insn, really_sorry,
push_float_handler, pop_float_handler): Add prototypes.
(fancy_abort): Mark prototype with ATTRIBUTE_NORETURN.
(do_abort, botch): Add prototypes.
From-SVN: r22293
1998-09-06 07:56:20 +02:00
typedef rtx ( * lang_expand_expr_t )
2000-01-17 16:55:18 +01:00
PARAMS ( ( union tree_node * , rtx , enum machine_mode ,
Makefile.in (toplev.o): Depend on $(EXPR_H).
* Makefile.in (toplev.o): Depend on $(EXPR_H).
(insn-extract.o, insn-attrtab.o): Depend on toplev.h.
* gansidecl.h: Define ATTRIBUTE_NORETURN.
* genattrtab.c: Have insn-attrtab.c include toplev.h.
* genextract.c: Have insn-extract.c include toplev.h.
* rtl.h: Don't prototype `fatal_insn_not_found' and `fatal_insn'.
* toplev.c: Include expr.h.
(really_sorry, fancy_abort): Remove prototypes.
(set_target_switch): Add argument in prototype.
(vfatal): Mark prototype with ATTRIBUTE_NORETURN.
(v_really_sorry): Likewise.
(print_version, print_single_switch, print_switch_values): Make
static and add prototype arguments.
(decl_printable_name): Add prototype arguments.
(lang_expand_expr_t): New typedef.
(lang_expand_expr): Declare as a lang_expand_expr_t.
(incomplete_decl_finalize_hook): Add prototype argument.
(decl_name): Mark variable `verbosity' with ATTRIBUTE_UNUSED.
(botch): Likewise for variable `s'.
(rest_of_type_compilation): Mark variables `type' and `toplev'
with ATTRIBUTE_UNUSED if none of DBX_DEBUGGING_INFO,
XCOFF_DEBUGGING_INFO or SDB_DEBUGGING_INFO are defined.
(display_help): Make variable `i' an `unsigned long'.
(main): Remove unused parameter `envp'.
Cast assignment to `lang_expand_expr' to a `lang_expand_expr_t'.
Cast -1 when comparing it with a `size_t'.
* toplev.h (fatal, fatal_io_error, pfatal_with_name): Mark
prototype with ATTRIBUTE_NORETURN.
(fatal_insn_not_found, fatal_insn, really_sorry,
push_float_handler, pop_float_handler): Add prototypes.
(fancy_abort): Mark prototype with ATTRIBUTE_NORETURN.
(do_abort, botch): Add prototypes.
From-SVN: r22293
1998-09-06 07:56:20 +02:00
enum expand_modifier modifier ) ) ;
lang_expand_expr_t lang_expand_expr = 0 ;
1992-02-06 00:20:23 +01:00
2000-01-17 16:55:18 +01:00
tree ( * lang_expand_constant ) PARAMS ( ( tree ) ) = 0 ;
1999-05-20 12:37:50 +02:00
1993-03-22 08:04:44 +01:00
/* Pointer to function to finish handling an incomplete decl at the
end of compilation . */
2000-01-17 16:55:18 +01:00
void ( * incomplete_decl_finalize_hook ) PARAMS ( ( tree ) ) = 0 ;
1993-03-22 08:04:44 +01:00
1992-02-06 00:20:23 +01:00
/* Nonzero if generating code to do profiling. */
int profile_flag = 0 ;
/* Nonzero if generating code to do profiling on a line-by-line basis. */
int profile_block_flag ;
1997-03-28 23:40:07 +01:00
/* Nonzero if generating code to profile program flow graph arcs. */
int profile_arc_flag = 0 ;
/* Nonzero if generating info for gcov to calculate line test coverage. */
int flag_test_coverage = 0 ;
/* Nonzero indicates that branch taken probabilities should be calculated. */
int flag_branch_probabilities = 0 ;
1992-02-06 00:20:23 +01:00
/* Nonzero for -pedantic switch: warn about anything
that standard spec forbids . */
int pedantic = 0 ;
/* Temporarily suppress certain warnings.
This is set while reading code from a system header file . */
int in_system_header = 0 ;
/* Nonzero means do stupid register allocation.
Currently , this is 1 if ` optimize ' is 0. */
int obey_regdecls = 0 ;
/* Don't print functions as they are compiled and don't print
times taken by the various passes . - quiet . */
int quiet_flag = 0 ;
/* -f flags. */
/* Nonzero means `char' should be signed. */
int flag_signed_char ;
/* Nonzero means give an enum type only as many bytes as it needs. */
int flag_short_enums ;
/* Nonzero for -fcaller-saves: allocate values in regs that need to
be saved across function calls , if that produces overall better code .
Optional now , so people can test it . */
# ifdef DEFAULT_CALLER_SAVES
int flag_caller_saves = 1 ;
# else
int flag_caller_saves = 0 ;
# endif
1993-03-24 00:13:50 +01:00
/* Nonzero if structures and unions should be returned in memory.
This should only be defined if compatibility with another compiler or
with an ABI is needed , because it results in slower code . */
# ifndef DEFAULT_PCC_STRUCT_RETURN
# define DEFAULT_PCC_STRUCT_RETURN 1
# endif
1992-02-06 00:20:23 +01:00
/* Nonzero for -fpcc-struct-return: return values the same way PCC does. */
1993-03-24 00:13:50 +01:00
int flag_pcc_struct_return = DEFAULT_PCC_STRUCT_RETURN ;
1992-02-06 00:20:23 +01:00
/* Nonzero for -fforce-mem: load memory value into a register
before arithmetic on it . This makes better cse but slower compilation . */
int flag_force_mem = 0 ;
/* Nonzero for -fforce-addr: load memory address into a register before
reference to memory . This makes better cse but slower compilation . */
int flag_force_addr = 0 ;
/* Nonzero for -fdefer-pop: don't pop args after each function call;
instead save them up to pop many calls ' args with one insns . */
1993-05-05 17:36:05 +02:00
int flag_defer_pop = 0 ;
1992-02-06 00:20:23 +01:00
/* Nonzero for -ffloat-store: don't allocate floats and doubles
in extended - precision registers . */
int flag_float_store = 0 ;
/* Nonzero for -fcse-follow-jumps:
have cse follow jumps to do a more extensive job . */
int flag_cse_follow_jumps ;
1992-04-05 18:34:53 +02:00
/* Nonzero for -fcse-skip-blocks:
have cse follow a branch around a block . */
int flag_cse_skip_blocks ;
1992-02-06 00:20:23 +01:00
/* Nonzero for -fexpensive-optimizations:
perform miscellaneous relatively - expensive optimizations . */
int flag_expensive_optimizations ;
/* Nonzero for -fthread-jumps:
have jump optimize output of loop . */
int flag_thread_jumps ;
/* Nonzero enables strength-reduction in loop.c. */
int flag_strength_reduce = 0 ;
/* Nonzero enables loop unrolling in unroll.c. Only loops for which the
number of iterations can be calculated at compile - time ( UNROLL_COMPLETELY ,
UNROLL_MODULO ) or at run - time ( preconditioned to be UNROLL_MODULO ) are
unrolled . */
int flag_unroll_loops ;
/* Nonzero enables loop unrolling in unroll.c. All loops are unrolled.
This is generally not a win . */
int flag_unroll_all_loops ;
1997-08-28 05:35:22 +02:00
/* Nonzero forces all invariant computations in loops to be moved
outside the loop . */
int flag_move_all_movables = 0 ;
/* Nonzero forces all general induction variables in loops to be
strength reduced . */
int flag_reduce_all_givs = 0 ;
1998-06-29 23:40:49 +02:00
/* Nonzero to perform full register move optimization passes. This is the
default for - O2 . */
int flag_regmove = 0 ;
1992-02-06 00:20:23 +01:00
/* Nonzero for -fwritable-strings:
store string constants in data segment and don ' t uniquize them . */
int flag_writable_strings = 0 ;
/* Nonzero means don't put addresses of constant functions in registers.
Used for compiling the Unix kernel , where strange substitutions are
done on the assembly output . */
int flag_no_function_cse = 0 ;
/* Nonzero for -fomit-frame-pointer:
don ' t make a frame pointer in simple functions that don ' t require one . */
int flag_omit_frame_pointer = 0 ;
1996-04-15 09:46:10 +02:00
/* Nonzero means place each function into its own section on those platforms
which support arbitrary section names and unlimited numbers of sections . */
int flag_function_sections = 0 ;
1998-09-28 12:57:35 +02:00
/* ... and similar for data. */
int flag_data_sections = 0 ;
1992-02-06 00:20:23 +01:00
/* Nonzero to inhibit use of define_optimization peephole opts. */
int flag_no_peephole = 0 ;
1992-04-01 00:17:47 +02:00
/* Nonzero allows GCC to violate some IEEE or ANSI rules regarding math
operations in the interest of optimization . For example it allows
GCC to assume arguments to sqrt are nonnegative numbers , allowing
1996-07-04 00:07:53 +02:00
faster code for sqrt to be generated . */
1992-04-01 00:17:47 +02:00
int flag_fast_math = 0 ;
1999-05-12 06:38:14 +02:00
/* Nonzero means the front end generally wants `errno' maintained by math
operations , like built - in SQRT , unless overridden by flag_fast_math . */
int flag_errno_math = 1 ;
1999-05-18 03:05:14 +02:00
/* 0 means straightforward implementation of complex divide acceptable.
1 means wide ranges of inputs must work for complex divide .
2 means C9X - like requirements for complex divide ( not yet implemented ) . */
int flag_complex_divide_method = 0 ;
1992-02-06 00:20:23 +01:00
/* Nonzero means all references through pointers are volatile. */
int flag_volatile ;
1993-03-09 06:15:15 +01:00
1999-01-27 02:43:17 +01:00
/* Nonzero means treat all global and extern variables as volatile. */
1993-03-09 06:15:15 +01:00
1993-03-08 22:29:49 +01:00
int flag_volatile_global ;
1992-02-06 00:20:23 +01:00
1999-01-27 02:43:17 +01:00
/* Nonzero means treat all static variables as volatile. */
int flag_volatile_static ;
1992-02-06 00:20:23 +01:00
/* Nonzero means just do syntax checking; don't output anything. */
int flag_syntax_only = 0 ;
1998-05-20 02:24:32 +02:00
/* Nonzero means perform global cse. */
static int flag_gcse ;
1999-09-23 21:57:50 +02:00
/* Nonzero means to use global dataflow analysis to eliminate
useless null pointer tests . */
static int flag_delete_null_pointer_checks ;
1992-02-06 00:20:23 +01:00
/* Nonzero means to rerun cse after loop optimization. This increases
compilation time about 20 % and picks up a few more common expressions . */
static int flag_rerun_cse_after_loop ;
1997-10-26 17:56:15 +01:00
/* Nonzero means to run loop optimizations twice. */
1997-11-09 09:35:46 +01:00
int flag_rerun_loop_opt ;
1997-10-26 17:56:15 +01:00
1992-02-06 00:20:23 +01:00
/* Nonzero for -finline-functions: ok to inline functions that look like
good inline candidates . */
int flag_inline_functions ;
/* Nonzero for -fkeep-inline-functions: even if we make a function
1993-01-10 23:49:32 +01:00
go inline everywhere , keep its definition around for debugging
1992-02-06 00:20:23 +01:00
purposes . */
int flag_keep_inline_functions ;
1994-10-18 07:58:28 +01:00
/* Nonzero means that functions will not be inlined. */
1992-02-06 00:20:23 +01:00
int flag_no_inline ;
1996-06-19 21:19:27 +02:00
/* Nonzero means that we should emit static const variables
regardless of whether or not optimization is turned on . */
int flag_keep_static_consts = 1 ;
1992-02-06 00:20:23 +01:00
/* Nonzero means we should be saving declaration info into a .X file. */
int flag_gen_aux_info = 0 ;
1992-03-23 20:29:32 +01:00
/* Specified name of aux-info file. */
static char * aux_info_file_name ;
1992-02-06 00:20:23 +01:00
/* Nonzero means make the text shared if supported. */
int flag_shared_data ;
/* Nonzero means schedule into delayed branch slots if supported. */
int flag_delayed_branch ;
/* Nonzero if we are compiling pure (sharable) code.
Value is 1 if we are doing reasonable ( i . e . simple
offset into offset table ) pic . Value is 2 if we can
only perform register offsets . */
int flag_pic ;
1996-07-23 21:58:32 +02:00
/* Nonzero means generate extra code for exception handling and enable
exception handling . */
1998-06-07 16:06:47 +02:00
int flag_exceptions ;
1996-07-23 21:58:32 +02:00
1998-06-08 14:43:28 +02:00
/* Nonzero means use the new model for exception handling. Replaces
- DNEW_EH_MODEL as a compile option . */
1999-08-13 10:23:35 +02:00
int flag_new_exceptions = 1 ;
1998-06-08 14:43:28 +02:00
[multiple changes]
Fri Oct 29 15:25:07 1999 Arnaud Charlet <charlet@ACT-Europe.FR>
* gcov.c (DIR_SEPARATOR): Provide default.
(output_data): Add test for MS-DOS format absolute filename.
(fancy_abort): Correct program name.
(open_files): Open all files in binary mode.
* libgcc2.c (__bb_exit_func): Likewise.
* profile.c (init_branch_prob): Specify binary when opening files.
* flags.h (flag_unwind_tables): New decl.
* toplev.c (flag_unwind_table): New definition.
(f_options): Add -funwind-tables.
(decode_g_option): Clarify warning when unknown -g option is given.
(rest_of_compilation): If inside an inlined external function,
pretend we are just being declared.
* dwarf2out.c (dwarf2out_do_frame): Check -funwind_tables.
(dwarf2out_frame_finish): Likewise.
Fri Oct 29 06:32:44 1999 Geoffrey Keating <geoffk@cygnus.com>
* flow.c (propagate_block): When the last reference to a label
before an ADDR_VEC is deleted because the reference is a dead
store, delete the ADDR_VEC.
Fri Oct 29 07:44:26 1999 Vasco Pedro <vp@di.fct.unl.pt>
* fold-const.c (merge_ranges): In not in0, but in1, handle
upper bounds equal like subset case.
Thu Oct 28 19:22:24 1999 Douglas Rupp <rupp@gnat.com>
* dbxout.c (dbxout_parms): Generate a second stabs line for parameters
passed in a register but moved to the stack.
Thu Oct 28 19:12:57 1999 Sam Tardieu <tardieu@act-europe.fr>
* gcc.c (pass_exit_codes, greatest_status): New variables.
(struct option_map): Add entry for "--pass-exit-codes".
(execute): Update greatest_status if error.
(display_help): Add documentation for -pass-exit-codes.
(process_command): Handle -pass-exit-codes.
(main): Look at pass_exit_codes and greatest_status on call to exit.
Thu Oct 28 18:06:50 1999 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* reload.c (find_reloads): Refine test for no input reload
case to not includes reloads emitted after insn.
* function.c (find_temp_slots_from_address): Handle sum involving
a register that points to a temp slot.
(update_temp_slot_address): Make recursive call if both old and
new are PLUS with a common operand.
* calls.c (expand_call): Mark temp slot for result as having
address taken.
* rtlanal.c (reg_referenced_p, case IF_THEN_ELSE): New case.
* gcc.c (process_command): Add standard_exec_prefix with "GCC"
component as well as "BINUTILS".
* integrate.h (copy_rtx_and_substitute): New arg, FOR_LHS.
* integrate.c (copy_rtx_and_substitute): Likewise.
(expand_inline_function, integrate_parm_decls, integrate_decl_tree):
All callers changed.
* unroll.c (inital_reg_note_copy, copy_loop_body): Likewise.
* dbxout.c (dbxout_type, case INTEGER_TYPE_NODE): If can use
gdb extensions, write size of type; also be more consistent
in using references when this is a subtype.
* pa.md (extv, extzv, insv): Use define_expand to reject constant
that is out of range.
* loop.c (unknown_constant_address_altered): New variable.
(prescan_loop): Initialize it.
(note_addr_stored): Set it for RTX_UNCHANGING_P MEM.
(invariant_p, case MEM): Remove handling for volatile and readony;
check new variable if readonly.
(check_dbra_loop): Chdeck unknown_constant_address_altered.
* cse.c (canon_hash, case MEM): Do not record if BLKmode.
(addr_affects_sp_p): Removed from note_mem_written and only
define #ifdef AUTO_INC_DEC.
* alpha.c (input_operand, case ADDRESSOF): Treat as REG.
* regclass.c (record_reg_classes): Properly handle register move
directions.
* varasm.c (initializer_constant_valid_p, case MINUS_EXPR):
Don't think valid if both operands are invalid.
(struct constant_descriptor): New field RTL.
(mark_const_hash_entry): Mark it.
(record_constant{,_rtx}): Initialize it.
(output_constant_def): Allocate RTL in permanent obstack and
save in table.
({record,compare}_constant_1): Modes must match for
CONSTRUCTOR of ARRAY_TYPE.
* c-common.h (initializer_constant_valid_p): Delete decl from here.
* output.h (initializer_constant_valid_p): Move decl to here.
* c-common.c (initializer_constant_valid_p): Delete function from here.
* varasm.c (initializer_constant_valid_p): Move function to here.
* tree.h (STRIP_SIGN_NOPS): New macro.
* fold-const.c (optimize_minmax_comparison): New function.
(invert_truthvalue, case WITH_RECORD_EXPR): New case.
(fold): Use STRIP_SIGN_NOPS instead of STRIP_TYPE_NOPS.
(fold, case EQ_EXPR): Call optimize_minmax_comparison and add
cases with ABS_EXPR, NEGATE_EXPR, PLUS_EXPR, MINUS_EXPR, and
widening conversions.
(fold, case LE_EXPR): Rework changing unsigned to signed comparisons
to look at size of mode, not precision of type; also add missing cases.
(optimize_bit_field_compare, decode_field_reference): Don't try to
optimize COMPONENT_REF of a PLACEHOLDER_EXPR.
* dwarf2out.c (ctype.h): Include.
(dwarf2out_set_demangle_name_func): New function.
(size_of_line_info): Deleted.
(output_line_info): Compute size of line info table from difference
of labels.
(base_type_die, add_name_attribute): Call demangle function, if any.
(field_byte_offset): Use bits per word for variable length fields.
(gen_array_type_die): Add array name.
(gen_subprogram_die): Ignore DECL_INLINE if -fno-inline.
(dwarf2out_add_library_unit_info): New function.
* explow.c (set_stack_check_libfunc): New function.
(stack_check_libfunc): New static variable.
(probe_stack_range): Allow front-end to set up a libfunc to call.
* combine.c (simplify_comparison): When making comparison in wider
mode, check for having commuted an AND and a SUBREG.
(contains_muldiv): New function.
(try_combine): Call it when dividing a PARALLEL.
(simplify_rtx, case TRUNCATE): Don't remove for umulsi3_highpart.
(simplify_comparison, case ASHIFTRT): Recognize sign-extension of
a PLUS.
(record_value_for_reg): If TEM is a binary operation with two CLOBBERs,
use one of the CLOBBERs instead.
(if_then_else_cond): If comparing against zero, just return thing
being compared.
* optabs.c (expand_abs): If machine has MAX, ABS (x) is MAX (x, -x).
Don't generate shifts and subtract if have conditional arithmetic.
* rtl.h (delete_barrier): New declaration.
* jump.c (jump_optimize): Set up to handle conditional call.
In conditional arithmetic case, handle CALL_INSN followed by a BARRIER.
(delete_barrier): New function.
* rtl.c (read_rtx): Call fatal if bad RTL code; check for bad mode.
* recog.c (nonmemory_operand): Accept ADDRESSOF.
* tree.c (build_type_attribute_variant): Push to obstack of
ttype around type_hash_canon call.
* expr.c (placeholder_list): Move decl to file scope.
(expand_expr): Don't force access to volatile just because its
address is taken.
If ignoring reference operations, just expand the operands.
(expand_expr, case COMPONENT_REF): Propagate
EXPAND_CONST_ADDRESS to recursive call when expanding inner.
Refine test for using bitfield operations vs pointer punning.
(expand_expr, case CONVERT_EXPR): If converting to
BLKmode UNION_TYPE from BLKmode, just return inner object.
Use proper mode in store_field call.
Properly set sizes of object to store and total size in store_field
call for convert to union.
(expand_expr, case ARRAY_REF): If OP0 is in a register, put it in
memory (like for ADDR_EXPR). Also, don't put constant in register if
we'll want it in memory.
(readonly_fields_p): New function.
(expand_expr, case INDIRECT_REF): Call it if LHS.
(expand_assignment): Handle a RESULT_DECL where
DECL_RTL is a PARALLEL.
(do_jump, case WITH_RECORD_EXPR): New case.
(get_inner_reference): Always go inside a CONVERT_EXPR
and NOP_EXPR if both modes are the same.
(store_field): Use bitfield operations if size of bitsize is not same
as size of RHS's type.
Check for bitpos not a multiple of alignment in BLKmode case.
Do block move in largest possible alignment.
(store_constructor): Set BITSIZE to -1 for variable size and properly
in case of array of BLKmode.
(expand_expr_unaligned): New function.
(do_compare_and_jump): Call it.
* mips/iris5.h (SWITCHES_NEED_SPACES): New macro.
* collect2.c (main): Only allow -ofoo if SWITCHES_NEED_SPACES
does not include 'o'.
* function.c (instantiate_virtual_regs_1, case SET): Handle case where
both SET_DEST and SET_SRC reference a virtual register.
(gen_mem_addressof): Copy RTX_UNCHANGING_P from new REG to old REG.
* integrate.c (expand_inline_function): Handle case of setting
virtual stack vars register (from built in setjmp); when parameter
lives in memory, expand virtual_{stack_vars,incoming_args}_rtx early.
(subst_constant): Add new parm, MEMONLY.
(expand_inline_function, integrate_parm_decls): Pass new parm.
(integrate_decl_tree): Likewise.
(copy_rtx_and_substitute, case MEM): Do copy RTX_UNCHANGING_P.
(try_constants): Call subst_constants twice, with MEMONLY 0 and 1.
(copy_rtx_and_substitute, case SET): Add explicit calls to
copy_rtx_and_substitute for both sides.
* stmt.c (expand_asm_operands): Don't use TREE_STRING_LENGTH for
constraints.
(pushcase{,_range}): Convert to NOMINAL_TYPE after checking for
within INDEX_TYPE, instead of before.
(fixup_gotos): Use f->target_rtl, not the next insn,
since latter may be from a later fixup.
(expand_value_return): Correctly convert VAL when promoting function
return; support RETURN_REG being a PARALLEL.
(expand_return): When checking for result in regs and having
cleanup, consider PARALLEL in DECL_RTL as being in regs.
From-SVN: r30299
1999-11-01 02:11:22 +01:00
/* Nonzero means generate frame unwind info table when supported */
int flag_unwind_tables = 0 ;
1996-05-06 20:36:48 +02:00
/* Nonzero means don't place uninitialized global data in common storage
1996-07-23 21:58:32 +02:00
by default . */
1992-02-06 00:20:23 +01:00
int flag_no_common ;
/* Nonzero means pretend it is OK to examine bits of target floats,
even if that isn ' t true . The resulting code will have incorrect constants ,
but the same series of instructions that the native compiler would make . */
int flag_pretend_float ;
/* Nonzero means change certain warnings into errors.
Usually these are warnings about failure to conform to some standard . */
int flag_pedantic_errors = 0 ;
/* flag_schedule_insns means schedule insns within basic blocks (before
local_alloc ) .
flag_schedule_insns_after_reload means schedule insns after
global_alloc . */
int flag_schedule_insns = 0 ;
int flag_schedule_insns_after_reload = 0 ;
1997-08-12 06:07:19 +02:00
/* The following flags have effect only for scheduling before register
allocation :
flag_schedule_interblock means schedule insns accross basic blocks .
flag_schedule_speculative means allow speculative motion of non - load insns .
flag_schedule_speculative_load means allow speculative motion of some
load insns .
flag_schedule_speculative_load_dangerous allows speculative motion of more
1998-02-15 23:28:33 +01:00
load insns . */
1997-08-12 06:07:19 +02:00
int flag_schedule_interblock = 1 ;
int flag_schedule_speculative = 1 ;
int flag_schedule_speculative_load = 0 ;
int flag_schedule_speculative_load_dangerous = 0 ;
/* flag_on_branch_count_reg means try to replace add-1,compare,branch tupple
by a cheaper branch , on a count register . */
int flag_branch_on_count_reg ;
1992-02-06 00:20:23 +01:00
/* -finhibit-size-directive inhibits output of .size for ELF.
This is used only for compiling crtstuff . c ,
and it may be extended to other effects
needed for crtstuff . c on other systems . */
int flag_inhibit_size_directive = 0 ;
1992-04-25 03:51:43 +02:00
/* -fverbose-asm causes extra commentary information to be produced in
the generated assembly code ( to make it more readable ) . This option
is generally only of use to those who actually need to read the
1996-05-17 18:36:13 +02:00
generated assembly code ( perhaps while debugging the compiler itself ) .
1998-01-14 21:57:58 +01:00
- fno - verbose - asm , the default , causes the extra information
1996-05-17 18:36:13 +02:00
to be omitted and is useful when comparing two assembler files . */
1998-01-14 21:57:58 +01:00
int flag_verbose_asm = 0 ;
1992-04-25 03:51:43 +02:00
1996-05-17 18:36:13 +02:00
/* -dA causes debug commentary information to be produced in
the generated assembly code ( to make it more readable ) . This option
is generally only of use to those who actually need to read the
generated assembly code ( perhaps while debugging the compiler itself ) .
Currently , this switch is only used by dwarfout . c ; however , it is intended
to be a catchall for printing debug information in the assembler file . */
int flag_debug_asm = 0 ;
1992-04-25 03:51:43 +02:00
1992-02-06 00:20:23 +01:00
/* -fgnu-linker specifies use of the GNU linker for initializations.
1992-03-30 23:39:24 +02:00
( Or , more generally , a linker that handles initializations . )
- fno - gnu - linker says that collect2 will be used . */
# ifdef USE_COLLECT2
int flag_gnu_linker = 0 ;
# else
1992-02-06 00:20:23 +01:00
int flag_gnu_linker = 1 ;
1992-03-30 23:39:24 +02:00
# endif
1992-02-06 00:20:23 +01:00
1995-03-31 16:35:03 +02:00
/* Tag all structures with __attribute__(packed) */
int flag_pack_struct = 0 ;
1997-07-17 17:26:41 +02:00
/* Emit code to check for stack overflow; also may cause large objects
to be allocated dynamically . */
int flag_stack_check ;
1999-12-04 04:00:04 +01:00
/* When non-NULL, indicates that whenever space is allocated on the
stack , the resulting stack pointer must not pass this
address - - - that is , for stacks that grow downward , the stack pointer
must always be greater than or equal to this address ; for stacks
that grow upward , the stack pointer must be less than this address .
At present , the rtx may be either a REG or a SYMBOL_REF , although
the support provided depends on the backend . */
rtx stack_limit_rtx ;
1997-08-02 19:20:21 +02:00
/* -fcheck-memory-usage causes extra code to be generated in order to check
memory accesses . This is used by a detector of bad memory accesses such
as Checker . */
int flag_check_memory_usage = 0 ;
/* -fprefix-function-name causes function name to be prefixed. This
can be used with - fcheck - memory - usage to isolate code compiled with
- fcheck - memory - usage . */
int flag_prefix_function_name = 0 ;
* Integrate alias analysis changes from jfc@mit.edu
* Makefile.in (OBJS): Add alias.o
(alias.o): Add dependencies.
* alias.c: New file.
* sched.c: Remove alias analysis code. It lives in alias.c now.
(reg_last_uses_size): Declare.
(sched_analyze_2): Add new arguments to true_dependence.
(sched_analyze_insn): Use reg_last_uses_size instead of max_reg.
(schedule_block): Initialize reg_last_uses_size.
(schedule_insns): Always call init_alias_analysis.
* calls.c (expand_call): Note calls to malloc, calloc, and realloc;
mark return value from such functions as a pointer and keep track of
them for alias analysis. If a return value from a function is a
pointer, mark it as such.
* combine.c (distribute_notes): Handle REG_NOALIAS.
* cse.c (struct write_data): Delete. No longer needed.
(invalidate): Don't call set_nonvarying_address_components anymore.
Use true_dependence to decide if an entry should be removed from
the hash table.
(invalidate_memory): Remove WRITES argument, simplify appropriately.
Fix all callers.
(note_mem_written): Similarly for WRITE_PTR argument.
(invalidate_from_clobbers): Similarly for W argument.
(invalidate_for_call): Remove memory elements from the hash table.
(refers_to_mem_p, cse_rtx_addr_varies_p): Deleted.
(cse_rtx_varies_p): New function. Derived from old
cse_rtx_addr_varies_p.
(cse_insn): Remove WRITES_MEMORY and INIT variables and all references.
Don't call note_mem_written anymore. Stack pushes invalidate the stack
pointer if PUSH_ROUNDING is defined. No longer need to call
cse_rtx_addr_varies_p to decide if a MEM should be invalidated.
(skipped_writes_memory): Remove variable.
(invalidate_skipped_set): Simplify and wewrite to use invalidate_memory.
(invalidate_skipped_block): Simplify for new alias analysis code.
(cse_set_around_loop): Likewise.
(cse_main): Call init_alias_analysis.
* flags.h (flag_alias_check, flag_argument_noalias): Declare.
* toplev.c (flag_alias_check, flag_argument_noalias): Define.
(f_options): Add new alias checking arguments.
(main): Set flag_alias_check when optimizing.
* local_alloc (validate_equiv_mem_from_store): Add new arguments
to true_dependence.
(memref_referenced_p): Likewise.
* loop.c (NUM_STORES): Increase to 30.
(prescan_loop): Only non-constant calls set unknown_address_altered.
(invariant_p): Add new arguments to true_dependence.
(record_giv): Initialize unrolled and shared fields.
(emit_iv_add_mult): Call record_base_value as needed.
* loop.h (struct induction): Add unrolled and shared fields.
* unroll.c (unroll_loop): Call record_base_value as needed.
(copy_loop_body): Likewise.
(final_biv_value): Likewise.
(final_giv_value): Likewise.
(find_splittable_regs): Likewise. Only create one new pseudo
if we have multiple address GIVs that were combined with the same
dst_reg GIV. Note when a new register is created due to unrolling.
* rtl.c (reg_note_name): Add REG_NOALIAS.
* rtl.h (enum reg_note): Similarly.
(rtx_varies_p, may_trap_p, side_effects_p): Declare.
(volatile_refs_p, volatile_insn_p, remove_note): Likewise.
(note_stores, refers_to_regno_p, reg_overlap_mentioned_p): Likewise.
(true_dependence, read_dependence, anti_dependence): Likewise.
(output_dependence, init_alias_analysis, end_alias_analysis): Likewise.
(mark_user_reg, mark_reg_pointer): Likewise.
jfc's alias analysis code.
From-SVN: r14768
1997-08-11 22:07:24 +02:00
/* 0 if pointer arguments may alias each other. True in C.
1 if pointer arguments may not alias each other but may alias
global variables .
2 if pointer arguments may not alias each other and may not
alias global variables . True in Fortran .
This defaults to 0 for C . */
int flag_argument_noalias = 0 ;
1998-06-25 17:14:41 +02:00
/* Nonzero if we should do (language-dependent) alias analysis.
Typically , this analysis will assume that expressions of certain
types do not alias expressions of certain other types . Only used
if alias analysis ( in general ) is enabled . */
int flag_strict_aliasing = 0 ;
1998-07-30 12:38:22 +02:00
/* Instrument functions with calls at entry and exit, for profiling. */
int flag_instrument_function_entry_exit = 0 ;
1999-01-31 18:46:42 +01:00
/* Nonzero means ignore `#ident' directives. 0 means handle them.
On SVR4 targets , it also controls whether or not to emit a
string identifying the compiler . */
int flag_no_ident = 0 ;
1998-07-13 19:20:29 +02:00
1999-08-31 22:37:09 +02:00
/* This will perform a peephole pass before sched2. */
int flag_peephole2 = 0 ;
1999-10-16 03:25:01 +02:00
/* -fbounded-pointers causes gcc to compile pointers as composite
objects occupying three words : the pointer value , the base address
of the referent object , and the address immediately beyond the end
of the referent object . The base and extent allow us to perform
runtime bounds checking . - fbounded - pointers implies - fcheck - bounds . */
int flag_bounded_pointers = 0 ;
/* -fcheck-bounds causes gcc to generate array bounds checks.
For C , C + + : defaults to value of flag_bounded_pointers .
For ObjC : defaults to off .
For Java : defaults to on .
For Fortran : defaults to off .
For CHILL : defaults to off . */
int flag_bounds_check = 0 ;
1999-11-04 08:23:58 +01:00
/* If one, renumber instruction UIDs to reduce the number of
unused UIDs if there are a lot of instructions . If greater than
one , unconditionally renumber instruction UIDs . */
int flag_renumber_insns = 1 ;
flags.h: New variables align_loops...
* flags.h: New variables align_loops, align_loops_log,
align_jumps, align_jumps_log, align_labels, align_labels_log,
align_functions, align_functions_log.
* toplev.c: Define them.
(f_options): Handle -falign-* when they have no argument.
(main): Add logic to set variables for -falign-functions,
-falign-jumps, -falign-labels, -falign-loops.
Make it -fsched-verbose=<n> and -finline-limit=<n>.
(display_help): Change help to match options.
* final.c (LABEL_ALIGN): Default to align_labels_log.
(LABEL_ALIGN_MAX_SKIP): Default to align_labels-1.
(LOOP_ALIGN): Default to align_loops_log.
(LOOP_ALIGN_MAX_SKIP): Default to align_loops-1.
(LABEL_ALIGN_AFTER_BARRIER): Default to align_jumps_log.
(LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP): Default to align_jumps-1.
* varasm.c (assemble_start_function): Handle align_functions.
* config/sparc/sparc.h: Don't declare sparc_align_*.
Don't provide LABEL_ALIGN_AFTER_BARRIER or LOOP_ALIGN.
(DEFAULT_SPARC_ALIGN_FUNCS): Delete; take functionality into
sparc.c.
(FUNCTION_BOUNDARY): Fix incorrect use---it's not just a request,
it's a promise.
* config/sparc/sparc.c: Delete sparc_align_loops,
sparc_align_jumps, sparc_align_funcs and the corresponding string
variables.
(sparc_override_options): Default align_functions on ultrasparc.
Delete -malign-* handling.
* config/mips/mips.c (override_options): On 64-bit targets,
try to align code to 64-bit boundaries.
(print_operand): New substitution, %~,
which aligns labels to align_labels_log.
* config/mips/mips.md (div_trap_normal): Use %~.
(div_trap_mips16): Likewise.
(abssi): Likewise.
(absdi2): Likewise.
(ffssi2): Likewise.
(ffsdi2): Likewise.
(ashldi3_internal): Likewise.
(ashrdi3_internal): Likewise.
(lshrdi3_internal): Likewise.
(casesi_internal): Likewise.
Plus corresponding documentation changes.
From-SVN: r29045
1999-09-02 07:42:06 +02:00
/* Values of the -falign-* flags: how much to align labels in code.
0 means ` use default ' , 1 means ` don ' t align ' .
For each variable , there is an _log variant which is the power
of two not less than the variable , for . align output . */
int align_loops ;
int align_loops_log ;
int align_jumps ;
int align_jumps_log ;
int align_labels ;
int align_labels_log ;
int align_functions ;
int align_functions_log ;
1998-07-13 19:20:29 +02:00
/* Table of supported debugging formats. */
static struct
{
cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
* cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
Instead of writing to const char *buf directly, use a non-const
variable `wbuf' to allocate and write a string, then set buf = wbuf.
* cppulp.c (user_label_prefix): Qualify a char* with the `const'
keyword.
* dyn-string.c (dyn_string_append): Likewise.
* dyn-string.h (dyn_string_append): Likewise.
* final.c (end_final, output_operand_lossage, asm_fprintf): Likewise.
* output.h (end_final, output_operand_lossage, asm_fprintf,
named_section, decode_reg_name, make_decl_rtl, user_label_prefix):
Likewise.
* profile.c (init_branch_prob): Likewise.
* toplev.c (set_target_switch, vmessage,
v_message_with_file_and_line, v_message_with_decl,
v_error_with_file_and_line, v_error_with_decl, v_error_for_asm,
verror, vfatal, v_warning_with_file_and_line, v_warning_with_decl,
v_warning_for_asm, vwarning, vpedwarn, v_pedwarn_with_decl,
v_pedwarn_with_file_and_line, vsorry, v_really_sorry,
open_dump_file, dump_rtl, clean_dump_file,
print_version, print_single_switch, print_switch_values,
dump_base_name, debug_args, lang_independent_options,
user_label_prefix, documented_lang_options, target_switches,
target_options, print_time, pfatal_with_name, fatal_io_error,
fatal_insn, default_print_error_function, print_error_function,
report_error_function, error_with_file_and_line, error_with_decl,
error_for_asm, error, fatal, warning_with_file_and_line,
warning_with_decl, warning_for_asm, warning, pedwarn,
pedwarn_with_decl, pedwarn_with_file_and_line, sorry,
really_sorry, botch, output_quoted_string, output_file_directive,
open_dump_file, rest_of_decl_compilation, display_help, main):
Likewise.
* toplev.h (print_time, fatal, fatal_io_error, pfatal_with_name,
fatal_insn, warning, error, pedwarn, pedwarn_with_file_and_line,
warning_with_file_and_line, error_with_file_and_line, sorry,
really_sorry, default_print_error_function, report_error_function,
rest_of_decl_compilation, pedwarn_with_decl, warning_with_decl,
error_with_decl, error_for_asm, warning_for_asm, output_quoted_string,
output_file_directive, botch): Likewise.
* tree.h (make_decl_rtl): Likewise.
* varasm.c (strip_reg_name, named_section, decode_reg_name,
make_decl_rtl): Likewise.
From-SVN: r24743
1999-01-18 09:53:41 +01:00
const char * arg ;
1998-07-13 19:20:29 +02:00
/* Since PREFERRED_DEBUGGING_TYPE isn't necessarily a
constant expression , we use NO_DEBUG in its place . */
enum debug_info_type debug_type ;
int use_extensions_p ;
cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
* cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
Instead of writing to const char *buf directly, use a non-const
variable `wbuf' to allocate and write a string, then set buf = wbuf.
* cppulp.c (user_label_prefix): Qualify a char* with the `const'
keyword.
* dyn-string.c (dyn_string_append): Likewise.
* dyn-string.h (dyn_string_append): Likewise.
* final.c (end_final, output_operand_lossage, asm_fprintf): Likewise.
* output.h (end_final, output_operand_lossage, asm_fprintf,
named_section, decode_reg_name, make_decl_rtl, user_label_prefix):
Likewise.
* profile.c (init_branch_prob): Likewise.
* toplev.c (set_target_switch, vmessage,
v_message_with_file_and_line, v_message_with_decl,
v_error_with_file_and_line, v_error_with_decl, v_error_for_asm,
verror, vfatal, v_warning_with_file_and_line, v_warning_with_decl,
v_warning_for_asm, vwarning, vpedwarn, v_pedwarn_with_decl,
v_pedwarn_with_file_and_line, vsorry, v_really_sorry,
open_dump_file, dump_rtl, clean_dump_file,
print_version, print_single_switch, print_switch_values,
dump_base_name, debug_args, lang_independent_options,
user_label_prefix, documented_lang_options, target_switches,
target_options, print_time, pfatal_with_name, fatal_io_error,
fatal_insn, default_print_error_function, print_error_function,
report_error_function, error_with_file_and_line, error_with_decl,
error_for_asm, error, fatal, warning_with_file_and_line,
warning_with_decl, warning_for_asm, warning, pedwarn,
pedwarn_with_decl, pedwarn_with_file_and_line, sorry,
really_sorry, botch, output_quoted_string, output_file_directive,
open_dump_file, rest_of_decl_compilation, display_help, main):
Likewise.
* toplev.h (print_time, fatal, fatal_io_error, pfatal_with_name,
fatal_insn, warning, error, pedwarn, pedwarn_with_file_and_line,
warning_with_file_and_line, error_with_file_and_line, sorry,
really_sorry, default_print_error_function, report_error_function,
rest_of_decl_compilation, pedwarn_with_decl, warning_with_decl,
error_with_decl, error_for_asm, warning_for_asm, output_quoted_string,
output_file_directive, botch): Likewise.
* tree.h (make_decl_rtl): Likewise.
* varasm.c (strip_reg_name, named_section, decode_reg_name,
make_decl_rtl): Likewise.
From-SVN: r24743
1999-01-18 09:53:41 +01:00
const char * description ;
1998-07-13 19:20:29 +02:00
} * da ,
debug_args [ ] =
{
1999-09-20 15:48:12 +02:00
{ " " , NO_DEBUG , DEFAULT_GDB_EXTENSIONS ,
1998-07-13 19:20:29 +02:00
" Generate default debug format output " } ,
1999-09-20 15:48:12 +02:00
{ " gdb " , NO_DEBUG , 1 , " Generate default extended debug format output " } ,
1998-07-13 19:20:29 +02:00
# ifdef DBX_DEBUGGING_INFO
1999-09-20 15:48:12 +02:00
{ " stabs " , DBX_DEBUG , 0 , " Generate STABS format debug output " } ,
{ " stabs+ " , DBX_DEBUG , 1 , " Generate extended STABS format debug output " } ,
1998-07-13 19:20:29 +02:00
# endif
# ifdef DWARF_DEBUGGING_INFO
1999-09-20 15:48:12 +02:00
{ " dwarf " , DWARF_DEBUG , 0 , " Generate DWARF-1 format debug output " } ,
{ " dwarf+ " , DWARF_DEBUG , 1 ,
1998-07-13 19:20:29 +02:00
" Generated extended DWARF-1 format debug output " } ,
# endif
# ifdef DWARF2_DEBUGGING_INFO
1999-09-20 15:48:12 +02:00
{ " dwarf-2 " , DWARF2_DEBUG , 0 , " Enable DWARF-2 debug output " } ,
1998-07-13 19:20:29 +02:00
# endif
# ifdef XCOFF_DEBUGGING_INFO
1999-09-20 15:48:12 +02:00
{ " xcoff " , XCOFF_DEBUG , 0 , " Generate XCOFF format debug output " } ,
{ " xcoff+ " , XCOFF_DEBUG , 1 , " Generate extended XCOFF format debug output " } ,
1998-07-13 19:20:29 +02:00
# endif
# ifdef SDB_DEBUGGING_INFO
1999-09-20 15:48:12 +02:00
{ " coff " , SDB_DEBUG , 0 , " Generate COFF format debug output " } ,
1998-07-13 19:20:29 +02:00
# endif
1998-10-13 17:25:25 +02:00
{ 0 , 0 , 0 , 0 }
1998-07-13 19:20:29 +02:00
} ;
typedef struct
{
cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
* cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
Instead of writing to const char *buf directly, use a non-const
variable `wbuf' to allocate and write a string, then set buf = wbuf.
* cppulp.c (user_label_prefix): Qualify a char* with the `const'
keyword.
* dyn-string.c (dyn_string_append): Likewise.
* dyn-string.h (dyn_string_append): Likewise.
* final.c (end_final, output_operand_lossage, asm_fprintf): Likewise.
* output.h (end_final, output_operand_lossage, asm_fprintf,
named_section, decode_reg_name, make_decl_rtl, user_label_prefix):
Likewise.
* profile.c (init_branch_prob): Likewise.
* toplev.c (set_target_switch, vmessage,
v_message_with_file_and_line, v_message_with_decl,
v_error_with_file_and_line, v_error_with_decl, v_error_for_asm,
verror, vfatal, v_warning_with_file_and_line, v_warning_with_decl,
v_warning_for_asm, vwarning, vpedwarn, v_pedwarn_with_decl,
v_pedwarn_with_file_and_line, vsorry, v_really_sorry,
open_dump_file, dump_rtl, clean_dump_file,
print_version, print_single_switch, print_switch_values,
dump_base_name, debug_args, lang_independent_options,
user_label_prefix, documented_lang_options, target_switches,
target_options, print_time, pfatal_with_name, fatal_io_error,
fatal_insn, default_print_error_function, print_error_function,
report_error_function, error_with_file_and_line, error_with_decl,
error_for_asm, error, fatal, warning_with_file_and_line,
warning_with_decl, warning_for_asm, warning, pedwarn,
pedwarn_with_decl, pedwarn_with_file_and_line, sorry,
really_sorry, botch, output_quoted_string, output_file_directive,
open_dump_file, rest_of_decl_compilation, display_help, main):
Likewise.
* toplev.h (print_time, fatal, fatal_io_error, pfatal_with_name,
fatal_insn, warning, error, pedwarn, pedwarn_with_file_and_line,
warning_with_file_and_line, error_with_file_and_line, sorry,
really_sorry, default_print_error_function, report_error_function,
rest_of_decl_compilation, pedwarn_with_decl, warning_with_decl,
error_with_decl, error_for_asm, warning_for_asm, output_quoted_string,
output_file_directive, botch): Likewise.
* tree.h (make_decl_rtl): Likewise.
* varasm.c (strip_reg_name, named_section, decode_reg_name,
make_decl_rtl): Likewise.
From-SVN: r24743
1999-01-18 09:53:41 +01:00
const char * string ;
1998-07-13 19:20:29 +02:00
int * variable ;
int on_value ;
cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
* cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
Instead of writing to const char *buf directly, use a non-const
variable `wbuf' to allocate and write a string, then set buf = wbuf.
* cppulp.c (user_label_prefix): Qualify a char* with the `const'
keyword.
* dyn-string.c (dyn_string_append): Likewise.
* dyn-string.h (dyn_string_append): Likewise.
* final.c (end_final, output_operand_lossage, asm_fprintf): Likewise.
* output.h (end_final, output_operand_lossage, asm_fprintf,
named_section, decode_reg_name, make_decl_rtl, user_label_prefix):
Likewise.
* profile.c (init_branch_prob): Likewise.
* toplev.c (set_target_switch, vmessage,
v_message_with_file_and_line, v_message_with_decl,
v_error_with_file_and_line, v_error_with_decl, v_error_for_asm,
verror, vfatal, v_warning_with_file_and_line, v_warning_with_decl,
v_warning_for_asm, vwarning, vpedwarn, v_pedwarn_with_decl,
v_pedwarn_with_file_and_line, vsorry, v_really_sorry,
open_dump_file, dump_rtl, clean_dump_file,
print_version, print_single_switch, print_switch_values,
dump_base_name, debug_args, lang_independent_options,
user_label_prefix, documented_lang_options, target_switches,
target_options, print_time, pfatal_with_name, fatal_io_error,
fatal_insn, default_print_error_function, print_error_function,
report_error_function, error_with_file_and_line, error_with_decl,
error_for_asm, error, fatal, warning_with_file_and_line,
warning_with_decl, warning_for_asm, warning, pedwarn,
pedwarn_with_decl, pedwarn_with_file_and_line, sorry,
really_sorry, botch, output_quoted_string, output_file_directive,
open_dump_file, rest_of_decl_compilation, display_help, main):
Likewise.
* toplev.h (print_time, fatal, fatal_io_error, pfatal_with_name,
fatal_insn, warning, error, pedwarn, pedwarn_with_file_and_line,
warning_with_file_and_line, error_with_file_and_line, sorry,
really_sorry, default_print_error_function, report_error_function,
rest_of_decl_compilation, pedwarn_with_decl, warning_with_decl,
error_with_decl, error_for_asm, warning_for_asm, output_quoted_string,
output_file_directive, botch): Likewise.
* tree.h (make_decl_rtl): Likewise.
* varasm.c (strip_reg_name, named_section, decode_reg_name,
make_decl_rtl): Likewise.
From-SVN: r24743
1999-01-18 09:53:41 +01:00
const char * description ;
1998-07-13 19:20:29 +02:00
}
lang_independent_options ;
1998-10-28 23:31:06 +01:00
/* Add or remove a leading underscore from user symbols. */
int flag_leading_underscore = - 1 ;
/* The user symbol prefix after having resolved same. */
cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
* cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
Instead of writing to const char *buf directly, use a non-const
variable `wbuf' to allocate and write a string, then set buf = wbuf.
* cppulp.c (user_label_prefix): Qualify a char* with the `const'
keyword.
* dyn-string.c (dyn_string_append): Likewise.
* dyn-string.h (dyn_string_append): Likewise.
* final.c (end_final, output_operand_lossage, asm_fprintf): Likewise.
* output.h (end_final, output_operand_lossage, asm_fprintf,
named_section, decode_reg_name, make_decl_rtl, user_label_prefix):
Likewise.
* profile.c (init_branch_prob): Likewise.
* toplev.c (set_target_switch, vmessage,
v_message_with_file_and_line, v_message_with_decl,
v_error_with_file_and_line, v_error_with_decl, v_error_for_asm,
verror, vfatal, v_warning_with_file_and_line, v_warning_with_decl,
v_warning_for_asm, vwarning, vpedwarn, v_pedwarn_with_decl,
v_pedwarn_with_file_and_line, vsorry, v_really_sorry,
open_dump_file, dump_rtl, clean_dump_file,
print_version, print_single_switch, print_switch_values,
dump_base_name, debug_args, lang_independent_options,
user_label_prefix, documented_lang_options, target_switches,
target_options, print_time, pfatal_with_name, fatal_io_error,
fatal_insn, default_print_error_function, print_error_function,
report_error_function, error_with_file_and_line, error_with_decl,
error_for_asm, error, fatal, warning_with_file_and_line,
warning_with_decl, warning_for_asm, warning, pedwarn,
pedwarn_with_decl, pedwarn_with_file_and_line, sorry,
really_sorry, botch, output_quoted_string, output_file_directive,
open_dump_file, rest_of_decl_compilation, display_help, main):
Likewise.
* toplev.h (print_time, fatal, fatal_io_error, pfatal_with_name,
fatal_insn, warning, error, pedwarn, pedwarn_with_file_and_line,
warning_with_file_and_line, error_with_file_and_line, sorry,
really_sorry, default_print_error_function, report_error_function,
rest_of_decl_compilation, pedwarn_with_decl, warning_with_decl,
error_with_decl, error_for_asm, warning_for_asm, output_quoted_string,
output_file_directive, botch): Likewise.
* tree.h (make_decl_rtl): Likewise.
* varasm.c (strip_reg_name, named_section, decode_reg_name,
make_decl_rtl): Likewise.
From-SVN: r24743
1999-01-18 09:53:41 +01:00
const char * user_label_prefix ;
1998-10-28 23:31:06 +01:00
/* A default for same. */
# ifndef USER_LABEL_PREFIX
# define USER_LABEL_PREFIX ""
# endif
1992-02-06 00:20:23 +01:00
/* Table of language-independent -f options.
STRING is the option name . VARIABLE is the address of the variable .
ON_VALUE is the value to store in VARIABLE
if ` - fSTRING ' is seen as an option .
( If ` - fno - STRING ' is seen as an option , the opposite value is stored . ) */
1998-07-13 19:20:29 +02:00
lang_independent_options f_options [ ] =
1992-02-06 00:20:23 +01:00
{
1998-07-13 19:20:29 +02:00
{ " float-store " , & flag_float_store , 1 ,
" Do not store floats in registers " } ,
{ " volatile " , & flag_volatile , 1 ,
" Consider all mem refs through pointers as volatile " } ,
{ " volatile-global " , & flag_volatile_global , 1 ,
" Consider all mem refs to global data to be volatile " } ,
1999-01-27 02:43:17 +01:00
{ " volatile-static " , & flag_volatile_static , 1 ,
" Consider all mem refs to static data to be volatile " } ,
1998-07-13 19:20:29 +02:00
{ " defer-pop " , & flag_defer_pop , 1 ,
" Defer popping functions args from stack until later " } ,
{ " omit-frame-pointer " , & flag_omit_frame_pointer , 1 ,
" When possible do not generate stack frames " } ,
{ " cse-follow-jumps " , & flag_cse_follow_jumps , 1 ,
" When running CSE, follow jumps to their targets " } ,
{ " cse-skip-blocks " , & flag_cse_skip_blocks , 1 ,
" When running CSE, follow conditional jumps " } ,
{ " expensive-optimizations " , & flag_expensive_optimizations , 1 ,
" Perform a number of minor, expensive optimisations " } ,
{ " thread-jumps " , & flag_thread_jumps , 1 ,
" Perform jump threading optimisations " } ,
{ " strength-reduce " , & flag_strength_reduce , 1 ,
" Perform strength reduction optimisations " } ,
{ " unroll-loops " , & flag_unroll_loops , 1 ,
1999-01-16 23:45:49 +01:00
" Perform loop unrolling when iteration count is known " } ,
1998-07-13 19:20:29 +02:00
{ " unroll-all-loops " , & flag_unroll_all_loops , 1 ,
1998-10-08 05:30:32 +02:00
" Perform loop unrolling for all loops " } ,
1998-07-13 19:20:29 +02:00
{ " move-all-movables " , & flag_move_all_movables , 1 ,
" Force all loop invariant computations out of loops " } ,
{ " reduce-all-givs " , & flag_reduce_all_givs , 1 ,
" Strength reduce all loop general induction variables " } ,
{ " writable-strings " , & flag_writable_strings , 1 ,
" Store strings in writable data section " } ,
{ " peephole " , & flag_no_peephole , 0 ,
" Enable machine specific peephole optimisations " } ,
{ " force-mem " , & flag_force_mem , 1 ,
" Copy memory operands into registers before using " } ,
{ " force-addr " , & flag_force_addr , 1 ,
" Copy memory address constants into regs before using " } ,
{ " function-cse " , & flag_no_function_cse , 0 ,
" Allow function addresses to be held in registers " } ,
{ " inline-functions " , & flag_inline_functions , 1 ,
" Integrate simple functions into their callers " } ,
{ " keep-inline-functions " , & flag_keep_inline_functions , 1 ,
" Generate code for funcs even if they are fully inlined " } ,
{ " inline " , & flag_no_inline , 0 ,
" Pay attention to the 'inline' keyword " } ,
{ " keep-static-consts " , & flag_keep_static_consts , 1 ,
" Emit static const variables even if they are not used " } ,
{ " syntax-only " , & flag_syntax_only , 1 ,
" Check for syntax errors, then stop " } ,
{ " shared-data " , & flag_shared_data , 1 ,
" Mark data as shared rather than private " } ,
{ " caller-saves " , & flag_caller_saves , 1 ,
" Enable saving registers around function calls " } ,
{ " pcc-struct-return " , & flag_pcc_struct_return , 1 ,
" Return 'short' aggregates in memory, not registers " } ,
{ " reg-struct-return " , & flag_pcc_struct_return , 0 ,
" Return 'short' aggregates in registers " } ,
{ " delayed-branch " , & flag_delayed_branch , 1 ,
" Attempt to fill delay slots of branch instructions " } ,
{ " gcse " , & flag_gcse , 1 ,
" Perform the global common subexpression elimination " } ,
{ " rerun-cse-after-loop " , & flag_rerun_cse_after_loop , 1 ,
" Run CSE pass after loop optimisations " } ,
{ " rerun-loop-opt " , & flag_rerun_loop_opt , 1 ,
" Run the loop optimiser twice " } ,
1999-09-23 21:57:50 +02:00
{ " delete-null-pointer-checks " , & flag_delete_null_pointer_checks , 1 ,
" Delete useless null pointer checks " } ,
1998-07-13 19:20:29 +02:00
{ " pretend-float " , & flag_pretend_float , 1 ,
" Pretend that host and target use the same FP format " } ,
{ " schedule-insns " , & flag_schedule_insns , 1 ,
" Reschedule instructions to avoid pipeline stalls " } ,
{ " schedule-insns2 " , & flag_schedule_insns_after_reload , 1 ,
" Run two passes of the instruction scheduler " } ,
{ " sched-interblock " , & flag_schedule_interblock , 1 ,
" Enable scheduling across basic blocks " } ,
{ " sched-spec " , & flag_schedule_speculative , 1 ,
" Allow speculative motion of non-loads " } ,
{ " sched-spec-load " , & flag_schedule_speculative_load , 1 ,
" Allow speculative motion of some loads " } ,
{ " sched-spec-load-dangerous " , & flag_schedule_speculative_load_dangerous , 1 ,
" Allow speculative motion of more loads " } ,
{ " branch-count-reg " , & flag_branch_on_count_reg , 1 ,
1998-07-14 16:18:56 +02:00
" Replace add,compare,branch with branch on count reg " } ,
1998-07-13 19:20:29 +02:00
{ " pic " , & flag_pic , 1 ,
" Generate position independent code, if possible " } ,
{ " PIC " , & flag_pic , 2 , " " } ,
{ " exceptions " , & flag_exceptions , 1 ,
" Enable exception handling " } ,
{ " new-exceptions " , & flag_new_exceptions , 1 ,
" Use the new model for exception handling " } ,
[multiple changes]
Fri Oct 29 15:25:07 1999 Arnaud Charlet <charlet@ACT-Europe.FR>
* gcov.c (DIR_SEPARATOR): Provide default.
(output_data): Add test for MS-DOS format absolute filename.
(fancy_abort): Correct program name.
(open_files): Open all files in binary mode.
* libgcc2.c (__bb_exit_func): Likewise.
* profile.c (init_branch_prob): Specify binary when opening files.
* flags.h (flag_unwind_tables): New decl.
* toplev.c (flag_unwind_table): New definition.
(f_options): Add -funwind-tables.
(decode_g_option): Clarify warning when unknown -g option is given.
(rest_of_compilation): If inside an inlined external function,
pretend we are just being declared.
* dwarf2out.c (dwarf2out_do_frame): Check -funwind_tables.
(dwarf2out_frame_finish): Likewise.
Fri Oct 29 06:32:44 1999 Geoffrey Keating <geoffk@cygnus.com>
* flow.c (propagate_block): When the last reference to a label
before an ADDR_VEC is deleted because the reference is a dead
store, delete the ADDR_VEC.
Fri Oct 29 07:44:26 1999 Vasco Pedro <vp@di.fct.unl.pt>
* fold-const.c (merge_ranges): In not in0, but in1, handle
upper bounds equal like subset case.
Thu Oct 28 19:22:24 1999 Douglas Rupp <rupp@gnat.com>
* dbxout.c (dbxout_parms): Generate a second stabs line for parameters
passed in a register but moved to the stack.
Thu Oct 28 19:12:57 1999 Sam Tardieu <tardieu@act-europe.fr>
* gcc.c (pass_exit_codes, greatest_status): New variables.
(struct option_map): Add entry for "--pass-exit-codes".
(execute): Update greatest_status if error.
(display_help): Add documentation for -pass-exit-codes.
(process_command): Handle -pass-exit-codes.
(main): Look at pass_exit_codes and greatest_status on call to exit.
Thu Oct 28 18:06:50 1999 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* reload.c (find_reloads): Refine test for no input reload
case to not includes reloads emitted after insn.
* function.c (find_temp_slots_from_address): Handle sum involving
a register that points to a temp slot.
(update_temp_slot_address): Make recursive call if both old and
new are PLUS with a common operand.
* calls.c (expand_call): Mark temp slot for result as having
address taken.
* rtlanal.c (reg_referenced_p, case IF_THEN_ELSE): New case.
* gcc.c (process_command): Add standard_exec_prefix with "GCC"
component as well as "BINUTILS".
* integrate.h (copy_rtx_and_substitute): New arg, FOR_LHS.
* integrate.c (copy_rtx_and_substitute): Likewise.
(expand_inline_function, integrate_parm_decls, integrate_decl_tree):
All callers changed.
* unroll.c (inital_reg_note_copy, copy_loop_body): Likewise.
* dbxout.c (dbxout_type, case INTEGER_TYPE_NODE): If can use
gdb extensions, write size of type; also be more consistent
in using references when this is a subtype.
* pa.md (extv, extzv, insv): Use define_expand to reject constant
that is out of range.
* loop.c (unknown_constant_address_altered): New variable.
(prescan_loop): Initialize it.
(note_addr_stored): Set it for RTX_UNCHANGING_P MEM.
(invariant_p, case MEM): Remove handling for volatile and readony;
check new variable if readonly.
(check_dbra_loop): Chdeck unknown_constant_address_altered.
* cse.c (canon_hash, case MEM): Do not record if BLKmode.
(addr_affects_sp_p): Removed from note_mem_written and only
define #ifdef AUTO_INC_DEC.
* alpha.c (input_operand, case ADDRESSOF): Treat as REG.
* regclass.c (record_reg_classes): Properly handle register move
directions.
* varasm.c (initializer_constant_valid_p, case MINUS_EXPR):
Don't think valid if both operands are invalid.
(struct constant_descriptor): New field RTL.
(mark_const_hash_entry): Mark it.
(record_constant{,_rtx}): Initialize it.
(output_constant_def): Allocate RTL in permanent obstack and
save in table.
({record,compare}_constant_1): Modes must match for
CONSTRUCTOR of ARRAY_TYPE.
* c-common.h (initializer_constant_valid_p): Delete decl from here.
* output.h (initializer_constant_valid_p): Move decl to here.
* c-common.c (initializer_constant_valid_p): Delete function from here.
* varasm.c (initializer_constant_valid_p): Move function to here.
* tree.h (STRIP_SIGN_NOPS): New macro.
* fold-const.c (optimize_minmax_comparison): New function.
(invert_truthvalue, case WITH_RECORD_EXPR): New case.
(fold): Use STRIP_SIGN_NOPS instead of STRIP_TYPE_NOPS.
(fold, case EQ_EXPR): Call optimize_minmax_comparison and add
cases with ABS_EXPR, NEGATE_EXPR, PLUS_EXPR, MINUS_EXPR, and
widening conversions.
(fold, case LE_EXPR): Rework changing unsigned to signed comparisons
to look at size of mode, not precision of type; also add missing cases.
(optimize_bit_field_compare, decode_field_reference): Don't try to
optimize COMPONENT_REF of a PLACEHOLDER_EXPR.
* dwarf2out.c (ctype.h): Include.
(dwarf2out_set_demangle_name_func): New function.
(size_of_line_info): Deleted.
(output_line_info): Compute size of line info table from difference
of labels.
(base_type_die, add_name_attribute): Call demangle function, if any.
(field_byte_offset): Use bits per word for variable length fields.
(gen_array_type_die): Add array name.
(gen_subprogram_die): Ignore DECL_INLINE if -fno-inline.
(dwarf2out_add_library_unit_info): New function.
* explow.c (set_stack_check_libfunc): New function.
(stack_check_libfunc): New static variable.
(probe_stack_range): Allow front-end to set up a libfunc to call.
* combine.c (simplify_comparison): When making comparison in wider
mode, check for having commuted an AND and a SUBREG.
(contains_muldiv): New function.
(try_combine): Call it when dividing a PARALLEL.
(simplify_rtx, case TRUNCATE): Don't remove for umulsi3_highpart.
(simplify_comparison, case ASHIFTRT): Recognize sign-extension of
a PLUS.
(record_value_for_reg): If TEM is a binary operation with two CLOBBERs,
use one of the CLOBBERs instead.
(if_then_else_cond): If comparing against zero, just return thing
being compared.
* optabs.c (expand_abs): If machine has MAX, ABS (x) is MAX (x, -x).
Don't generate shifts and subtract if have conditional arithmetic.
* rtl.h (delete_barrier): New declaration.
* jump.c (jump_optimize): Set up to handle conditional call.
In conditional arithmetic case, handle CALL_INSN followed by a BARRIER.
(delete_barrier): New function.
* rtl.c (read_rtx): Call fatal if bad RTL code; check for bad mode.
* recog.c (nonmemory_operand): Accept ADDRESSOF.
* tree.c (build_type_attribute_variant): Push to obstack of
ttype around type_hash_canon call.
* expr.c (placeholder_list): Move decl to file scope.
(expand_expr): Don't force access to volatile just because its
address is taken.
If ignoring reference operations, just expand the operands.
(expand_expr, case COMPONENT_REF): Propagate
EXPAND_CONST_ADDRESS to recursive call when expanding inner.
Refine test for using bitfield operations vs pointer punning.
(expand_expr, case CONVERT_EXPR): If converting to
BLKmode UNION_TYPE from BLKmode, just return inner object.
Use proper mode in store_field call.
Properly set sizes of object to store and total size in store_field
call for convert to union.
(expand_expr, case ARRAY_REF): If OP0 is in a register, put it in
memory (like for ADDR_EXPR). Also, don't put constant in register if
we'll want it in memory.
(readonly_fields_p): New function.
(expand_expr, case INDIRECT_REF): Call it if LHS.
(expand_assignment): Handle a RESULT_DECL where
DECL_RTL is a PARALLEL.
(do_jump, case WITH_RECORD_EXPR): New case.
(get_inner_reference): Always go inside a CONVERT_EXPR
and NOP_EXPR if both modes are the same.
(store_field): Use bitfield operations if size of bitsize is not same
as size of RHS's type.
Check for bitpos not a multiple of alignment in BLKmode case.
Do block move in largest possible alignment.
(store_constructor): Set BITSIZE to -1 for variable size and properly
in case of array of BLKmode.
(expand_expr_unaligned): New function.
(do_compare_and_jump): Call it.
* mips/iris5.h (SWITCHES_NEED_SPACES): New macro.
* collect2.c (main): Only allow -ofoo if SWITCHES_NEED_SPACES
does not include 'o'.
* function.c (instantiate_virtual_regs_1, case SET): Handle case where
both SET_DEST and SET_SRC reference a virtual register.
(gen_mem_addressof): Copy RTX_UNCHANGING_P from new REG to old REG.
* integrate.c (expand_inline_function): Handle case of setting
virtual stack vars register (from built in setjmp); when parameter
lives in memory, expand virtual_{stack_vars,incoming_args}_rtx early.
(subst_constant): Add new parm, MEMONLY.
(expand_inline_function, integrate_parm_decls): Pass new parm.
(integrate_decl_tree): Likewise.
(copy_rtx_and_substitute, case MEM): Do copy RTX_UNCHANGING_P.
(try_constants): Call subst_constants twice, with MEMONLY 0 and 1.
(copy_rtx_and_substitute, case SET): Add explicit calls to
copy_rtx_and_substitute for both sides.
* stmt.c (expand_asm_operands): Don't use TREE_STRING_LENGTH for
constraints.
(pushcase{,_range}): Convert to NOMINAL_TYPE after checking for
within INDEX_TYPE, instead of before.
(fixup_gotos): Use f->target_rtl, not the next insn,
since latter may be from a later fixup.
(expand_value_return): Correctly convert VAL when promoting function
return; support RETURN_REG being a PARALLEL.
(expand_return): When checking for result in regs and having
cleanup, consider PARALLEL in DECL_RTL as being in regs.
From-SVN: r30299
1999-11-01 02:11:22 +01:00
{ " unwind-tables " , & flag_unwind_tables , 1 ,
" Just generate unwind tables for exception handling " } ,
1998-07-13 19:20:29 +02:00
{ " sjlj-exceptions " , & exceptions_via_longjmp , 1 ,
" Use setjmp/longjmp to handle exceptions " } ,
{ " asynchronous-exceptions " , & asynchronous_exceptions , 1 ,
" Support asynchronous exceptions " } ,
{ " profile-arcs " , & profile_arc_flag , 1 ,
" Insert arc based program profiling code " } ,
{ " test-coverage " , & flag_test_coverage , 1 ,
" Create data files needed by gcov " } ,
{ " branch-probabilities " , & flag_branch_probabilities , 1 ,
1999-01-16 23:45:49 +01:00
" Use profiling information for branch probabilities " } ,
1998-07-13 19:20:29 +02:00
{ " fast-math " , & flag_fast_math , 1 ,
" Improve FP speed by violating ANSI & IEEE rules " } ,
{ " common " , & flag_no_common , 0 ,
" Do not put unitialised globals in the common section " } ,
{ " inhibit-size-directive " , & flag_inhibit_size_directive , 1 ,
" Do not generate .size directives " } ,
{ " function-sections " , & flag_function_sections , 1 ,
" place each function into its own section " } ,
1998-09-30 10:26:10 +02:00
{ " data-sections " , & flag_data_sections , 1 ,
" place data items into their own section " } ,
1998-07-13 19:20:29 +02:00
{ " verbose-asm " , & flag_verbose_asm , 1 ,
" Add extra commentry to assembler output " } ,
{ " gnu-linker " , & flag_gnu_linker , 1 ,
" Output GNU ld formatted global initialisers " } ,
{ " regmove " , & flag_regmove , 1 ,
1998-10-13 17:25:25 +02:00
" Enables a register move optimisation " } ,
{ " optimize-register-move " , & flag_regmove , 1 ,
" Do the full regmove optimization pass " } ,
1998-07-13 19:20:29 +02:00
{ " pack-struct " , & flag_pack_struct , 1 ,
" Pack structure members together without holes " } ,
{ " stack-check " , & flag_stack_check , 1 ,
" Insert stack checking code into the program " } ,
{ " argument-alias " , & flag_argument_noalias , 0 ,
" Specify that arguments may alias each other & globals " } ,
{ " argument-noalias " , & flag_argument_noalias , 1 ,
" Assume arguments may alias globals but not each other " } ,
{ " argument-noalias-global " , & flag_argument_noalias , 2 ,
" Assume arguments do not alias each other or globals " } ,
{ " strict-aliasing " , & flag_strict_aliasing , 1 ,
" Assume strict aliasing rules apply " } ,
flags.h: New variables align_loops...
* flags.h: New variables align_loops, align_loops_log,
align_jumps, align_jumps_log, align_labels, align_labels_log,
align_functions, align_functions_log.
* toplev.c: Define them.
(f_options): Handle -falign-* when they have no argument.
(main): Add logic to set variables for -falign-functions,
-falign-jumps, -falign-labels, -falign-loops.
Make it -fsched-verbose=<n> and -finline-limit=<n>.
(display_help): Change help to match options.
* final.c (LABEL_ALIGN): Default to align_labels_log.
(LABEL_ALIGN_MAX_SKIP): Default to align_labels-1.
(LOOP_ALIGN): Default to align_loops_log.
(LOOP_ALIGN_MAX_SKIP): Default to align_loops-1.
(LABEL_ALIGN_AFTER_BARRIER): Default to align_jumps_log.
(LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP): Default to align_jumps-1.
* varasm.c (assemble_start_function): Handle align_functions.
* config/sparc/sparc.h: Don't declare sparc_align_*.
Don't provide LABEL_ALIGN_AFTER_BARRIER or LOOP_ALIGN.
(DEFAULT_SPARC_ALIGN_FUNCS): Delete; take functionality into
sparc.c.
(FUNCTION_BOUNDARY): Fix incorrect use---it's not just a request,
it's a promise.
* config/sparc/sparc.c: Delete sparc_align_loops,
sparc_align_jumps, sparc_align_funcs and the corresponding string
variables.
(sparc_override_options): Default align_functions on ultrasparc.
Delete -malign-* handling.
* config/mips/mips.c (override_options): On 64-bit targets,
try to align code to 64-bit boundaries.
(print_operand): New substitution, %~,
which aligns labels to align_labels_log.
* config/mips/mips.md (div_trap_normal): Use %~.
(div_trap_mips16): Likewise.
(abssi): Likewise.
(absdi2): Likewise.
(ffssi2): Likewise.
(ffsdi2): Likewise.
(ashldi3_internal): Likewise.
(ashrdi3_internal): Likewise.
(lshrdi3_internal): Likewise.
(casesi_internal): Likewise.
Plus corresponding documentation changes.
From-SVN: r29045
1999-09-02 07:42:06 +02:00
{ " align-loops " , & align_loops , 0 ,
" Align the start of loops " } ,
{ " align-jumps " , & align_jumps , 0 ,
" Align labels which are only reached by jumping " } ,
{ " align-labels " , & align_labels , 0 ,
" Align all labels " } ,
{ " align-functions " , & align_functions , 0 ,
" Align the start of functions " } ,
1998-07-13 19:20:29 +02:00
{ " check-memory-usage " , & flag_check_memory_usage , 1 ,
" Generate code to check every memory access " } ,
{ " prefix-function-name " , & flag_prefix_function_name , 1 ,
" Add a prefix to all function names " } ,
1998-10-13 17:25:25 +02:00
{ " dump-unnumbered " , & flag_dump_unnumbered , 1 ,
" Suppress output of instruction numbers and line number notes in debugging dumps " } ,
1998-07-30 12:38:22 +02:00
{ " instrument-functions " , & flag_instrument_function_entry_exit , 1 ,
" Instrument function entry/exit with profiling calls " } ,
1998-10-28 23:31:06 +01:00
{ " leading-underscore " , & flag_leading_underscore , 1 ,
1999-01-31 18:46:42 +01:00
" External symbols have a leading underscore " } ,
{ " ident " , & flag_no_ident , 0 ,
1999-08-31 22:37:09 +02:00
" Process #ident directives " } ,
{ " peephole2 " , & flag_peephole2 , 1 ,
1999-09-16 03:17:50 +02:00
" Enables an rtl peephole pass run before sched2 " } ,
{ " math-errno " , & flag_errno_math , 1 ,
1999-10-16 03:25:01 +02:00
" Set errno after built-in math functions " } ,
{ " bounded-pointers " , & flag_bounded_pointers , 1 ,
" Compile pointers as triples: value, base & end " } ,
{ " bounds-check " , & flag_bounds_check , 1 ,
" Generate code to check bounds before dereferencing pointers and arrays " }
1992-02-06 00:20:23 +01:00
} ;
1992-09-02 07:33:36 +02:00
1998-07-13 19:20:29 +02:00
# define NUM_ELEM(a) (sizeof (a) / sizeof ((a)[0]))
1992-09-02 07:33:36 +02:00
/* Table of language-specific options. */
1998-07-13 19:20:29 +02:00
static struct lang_opt
{
cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
* cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
Instead of writing to const char *buf directly, use a non-const
variable `wbuf' to allocate and write a string, then set buf = wbuf.
* cppulp.c (user_label_prefix): Qualify a char* with the `const'
keyword.
* dyn-string.c (dyn_string_append): Likewise.
* dyn-string.h (dyn_string_append): Likewise.
* final.c (end_final, output_operand_lossage, asm_fprintf): Likewise.
* output.h (end_final, output_operand_lossage, asm_fprintf,
named_section, decode_reg_name, make_decl_rtl, user_label_prefix):
Likewise.
* profile.c (init_branch_prob): Likewise.
* toplev.c (set_target_switch, vmessage,
v_message_with_file_and_line, v_message_with_decl,
v_error_with_file_and_line, v_error_with_decl, v_error_for_asm,
verror, vfatal, v_warning_with_file_and_line, v_warning_with_decl,
v_warning_for_asm, vwarning, vpedwarn, v_pedwarn_with_decl,
v_pedwarn_with_file_and_line, vsorry, v_really_sorry,
open_dump_file, dump_rtl, clean_dump_file,
print_version, print_single_switch, print_switch_values,
dump_base_name, debug_args, lang_independent_options,
user_label_prefix, documented_lang_options, target_switches,
target_options, print_time, pfatal_with_name, fatal_io_error,
fatal_insn, default_print_error_function, print_error_function,
report_error_function, error_with_file_and_line, error_with_decl,
error_for_asm, error, fatal, warning_with_file_and_line,
warning_with_decl, warning_for_asm, warning, pedwarn,
pedwarn_with_decl, pedwarn_with_file_and_line, sorry,
really_sorry, botch, output_quoted_string, output_file_directive,
open_dump_file, rest_of_decl_compilation, display_help, main):
Likewise.
* toplev.h (print_time, fatal, fatal_io_error, pfatal_with_name,
fatal_insn, warning, error, pedwarn, pedwarn_with_file_and_line,
warning_with_file_and_line, error_with_file_and_line, sorry,
really_sorry, default_print_error_function, report_error_function,
rest_of_decl_compilation, pedwarn_with_decl, warning_with_decl,
error_with_decl, error_for_asm, warning_for_asm, output_quoted_string,
output_file_directive, botch): Likewise.
* tree.h (make_decl_rtl): Likewise.
* varasm.c (strip_reg_name, named_section, decode_reg_name,
make_decl_rtl): Likewise.
From-SVN: r24743
1999-01-18 09:53:41 +01:00
const char * option ;
const char * description ;
1998-07-13 19:20:29 +02:00
}
documented_lang_options [ ] =
1992-09-02 07:33:36 +02:00
{
1998-07-13 19:20:29 +02:00
/* In order not to overload the --help output, the convention
used here is to only describe those options which are not
enabled by default . */
{ " -ansi " , " Compile just for ANSI C " } ,
{ " -fallow-single-precision " ,
" Do not promote floats to double if using -traditional " } ,
1998-12-01 22:05:17 +01:00
{ " -std= " , " Determine language standard " } ,
1998-07-13 19:20:29 +02:00
{ " -fsigned-bitfields " , " " } ,
{ " -funsigned-bitfields " , " Make bitfields by unsigned by default " } ,
{ " -fno-signed-bitfields " , " " } ,
{ " -fno-unsigned-bitfields " , " " } ,
{ " -fsigned-char " , " Make 'char' be signed by default " } ,
{ " -funsigned-char " , " Make 'char' be unsigned by default " } ,
{ " -fno-signed-char " , " " } ,
{ " -fno-unsigned-char " , " " } ,
{ " -ftraditional " , " " } ,
{ " -traditional " , " Attempt to support traditional K&R style C " } ,
{ " -fnotraditional " , " " } ,
{ " -fno-traditional " , " " } ,
{ " -fasm " , " " } ,
{ " -fno-asm " , " Do not recognise the 'asm' keyword " } ,
{ " -fbuiltin " , " " } ,
{ " -fno-builtin " , " Do not recognise any built in functions " } ,
{ " -fhosted " , " Assume normal C execution environment " } ,
{ " -fno-hosted " , " " } ,
{ " -ffreestanding " ,
" Assume that standard libraries & main might not exist " } ,
{ " -fno-freestanding " , " " } ,
{ " -fcond-mismatch " , " Allow different types as args of ? operator " } ,
{ " -fno-cond-mismatch " , " " } ,
1999-01-16 23:45:49 +01:00
{ " -fdollars-in-identifiers " , " Allow the use of $ inside identifiers " } ,
1998-07-13 19:20:29 +02:00
{ " -fno-dollars-in-identifiers " , " " } ,
1999-07-20 21:13:01 +02:00
{ " -fpreprocessed " , " " } ,
{ " -fno-preprocessed " , " " } ,
1998-07-13 19:20:29 +02:00
{ " -fshort-double " , " Use the same size for double as for float " } ,
{ " -fno-short-double " , " " } ,
{ " -fshort-enums " , " Use the smallest fitting integer to hold enums " } ,
{ " -fno-short-enums " , " " } ,
1999-09-23 23:03:53 +02:00
{ " -fshort-wchar " , " Override the underlying type for wchar_t to `unsigned short' " } ,
{ " -fno-short-wchar " , " " } ,
1998-07-13 19:20:29 +02:00
{ " -Wall " , " Enable most warning messages " } ,
{ " -Wbad-function-cast " ,
" Warn about casting functions to incompatible types " } ,
{ " -Wno-bad-function-cast " , " " } ,
1998-10-20 09:32:08 +02:00
{ " -Wmissing-noreturn " ,
" Warn about functions which might be candidates for attribute noreturn " } ,
{ " -Wno-missing-noreturn " , " " } ,
1998-07-13 19:20:29 +02:00
{ " -Wcast-qual " , " Warn about casts which discard qualifiers " } ,
{ " -Wno-cast-qual " , " " } ,
1998-09-28 21:13:25 +02:00
{ " -Wchar-subscripts " , " Warn about subscripts whose type is 'char' " } ,
1998-07-13 19:20:29 +02:00
{ " -Wno-char-subscripts " , " " } ,
{ " -Wcomment " , " Warn if nested comments are detected " } ,
1998-10-13 17:25:25 +02:00
{ " -Wno-comment " , " " } ,
{ " -Wcomments " , " Warn if nested comments are detected " } ,
{ " -Wno-comments " , " " } ,
1998-07-13 19:20:29 +02:00
{ " -Wconversion " , " Warn about possibly confusing type conversions " } ,
{ " -Wno-conversion " , " " } ,
{ " -Wformat " , " Warn about printf format anomalies " } ,
{ " -Wno-format " , " " } ,
{ " -Wimplicit-function-declaration " ,
" Warn about implicit function declarations " } ,
{ " -Wno-implicit-function-declaration " , " " } ,
{ " -Werror-implicit-function-declaration " , " " } ,
{ " -Wimplicit-int " , " Warn when a declaration does not specify a type " } ,
{ " -Wno-implicit-int " , " " } ,
{ " -Wimplicit " , " " } ,
{ " -Wno-implicit " , " " } ,
{ " -Wimport " , " Warn about the use of the #import directive " } ,
{ " -Wno-import " , " " } ,
{ " -Wlong-long " , " " } ,
{ " -Wno-long-long " , " Do not warn about using 'long long' when -pedantic " } ,
{ " -Wmain " , " Warn about suspicious declarations of main " } ,
{ " -Wno-main " , " " } ,
{ " -Wmissing-braces " ,
" Warn about possibly missing braces around initialisers " } ,
{ " -Wno-missing-braces " , " " } ,
{ " -Wmissing-declarations " ,
" Warn about global funcs without previous declarations " } ,
{ " -Wno-missing-declarations " , " " } ,
{ " -Wmissing-prototypes " , " Warn about global funcs without prototypes " } ,
{ " -Wno-missing-prototypes " , " " } ,
{ " -Wmultichar " , " Warn about use of multicharacter literals " } ,
{ " -Wno-multichar " , " " } ,
{ " -Wnested-externs " , " Warn about externs not at file scope level " } ,
{ " -Wno-nested-externs " , " " } ,
{ " -Wparentheses " , " Warn about possible missing parentheses " } ,
{ " -Wno-parentheses " , " " } ,
{ " -Wpointer-arith " , " Warn about function pointer arithmetic " } ,
{ " -Wno-pointer-arith " , " " } ,
{ " -Wredundant-decls " ,
" Warn about multiple declarations of the same object " } ,
{ " -Wno-redundant-decls " , " " } ,
{ " -Wsign-compare " , " Warn about signed/unsigned comparisons " } ,
{ " -Wno-sign-compare " , " " } ,
1999-09-30 08:19:54 +02:00
{ " -Wfloat-equal " , " Warn about testing equality of floating point numbers " } ,
{ " -Wno-float-equal " , " " } ,
1998-07-13 19:20:29 +02:00
{ " -Wunknown-pragmas " , " Warn about unrecognised pragmas " } ,
{ " -Wno-unknown-pragmas " , " " } ,
{ " -Wstrict-prototypes " , " Warn about non-prototyped function decls " } ,
{ " -Wno-strict-prototypes " , " " } ,
1998-09-28 21:13:25 +02:00
{ " -Wtraditional " , " Warn about constructs whose meaning change in ANSI C " } ,
1998-07-13 19:20:29 +02:00
{ " -Wno-traditional " , " " } ,
{ " -Wtrigraphs " , " Warn when trigraphs are encountered " } ,
{ " -Wno-trigraphs " , " " } ,
{ " -Wundef " , " " } ,
{ " -Wno-undef " , " " } ,
{ " -Wwrite-strings " , " Mark strings as 'const char *' " } ,
{ " -Wno-write-strings " , " " } ,
# define DEFINE_LANG_NAME(NAME) { NULL, NAME },
1999-09-20 15:48:12 +02:00
/* These are for Objective C. */
1998-07-13 19:20:29 +02:00
DEFINE_LANG_NAME ( " Objective C " )
{ " -lang-objc " , " " } ,
{ " -gen-decls " , " Dump decls to a .decl file " } ,
1999-01-16 23:45:49 +01:00
{ " -fgnu-runtime " , " Generate code for GNU runtime environment " } ,
1998-07-13 19:20:29 +02:00
{ " -fno-gnu-runtime " , " " } ,
{ " -fnext-runtime " , " Generate code for NeXT runtime environment " } ,
{ " -fno-next-runtime " , " " } ,
{ " -Wselector " , " Warn if a selector has multiple methods " } ,
{ " -Wno-selector " , " " } ,
{ " -Wprotocol " , " " } ,
{ " -Wno-protocol " , " Do not warn if inherited methods are unimplemented " } ,
{ " -print-objc-runtime-info " ,
" Generate C header of platform specific features " } ,
1998-06-10 12:12:36 +02:00
1995-05-14 16:38:16 +02:00
# include "options.h"
1998-07-13 19:20:29 +02:00
1992-09-02 07:33:36 +02:00
} ;
1998-07-13 19:20:29 +02:00
/* Here is a table, controlled by the tm.h file, listing each -m switch
and which bits in ` target_switches ' it should set or clear .
If VALUE is positive , it is bits to set .
If VALUE is negative , - VALUE is bits to clear .
( The sign bit is not used so there is no confusion . ) */
struct
{
cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
* cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
Instead of writing to const char *buf directly, use a non-const
variable `wbuf' to allocate and write a string, then set buf = wbuf.
* cppulp.c (user_label_prefix): Qualify a char* with the `const'
keyword.
* dyn-string.c (dyn_string_append): Likewise.
* dyn-string.h (dyn_string_append): Likewise.
* final.c (end_final, output_operand_lossage, asm_fprintf): Likewise.
* output.h (end_final, output_operand_lossage, asm_fprintf,
named_section, decode_reg_name, make_decl_rtl, user_label_prefix):
Likewise.
* profile.c (init_branch_prob): Likewise.
* toplev.c (set_target_switch, vmessage,
v_message_with_file_and_line, v_message_with_decl,
v_error_with_file_and_line, v_error_with_decl, v_error_for_asm,
verror, vfatal, v_warning_with_file_and_line, v_warning_with_decl,
v_warning_for_asm, vwarning, vpedwarn, v_pedwarn_with_decl,
v_pedwarn_with_file_and_line, vsorry, v_really_sorry,
open_dump_file, dump_rtl, clean_dump_file,
print_version, print_single_switch, print_switch_values,
dump_base_name, debug_args, lang_independent_options,
user_label_prefix, documented_lang_options, target_switches,
target_options, print_time, pfatal_with_name, fatal_io_error,
fatal_insn, default_print_error_function, print_error_function,
report_error_function, error_with_file_and_line, error_with_decl,
error_for_asm, error, fatal, warning_with_file_and_line,
warning_with_decl, warning_for_asm, warning, pedwarn,
pedwarn_with_decl, pedwarn_with_file_and_line, sorry,
really_sorry, botch, output_quoted_string, output_file_directive,
open_dump_file, rest_of_decl_compilation, display_help, main):
Likewise.
* toplev.h (print_time, fatal, fatal_io_error, pfatal_with_name,
fatal_insn, warning, error, pedwarn, pedwarn_with_file_and_line,
warning_with_file_and_line, error_with_file_and_line, sorry,
really_sorry, default_print_error_function, report_error_function,
rest_of_decl_compilation, pedwarn_with_decl, warning_with_decl,
error_with_decl, error_for_asm, warning_for_asm, output_quoted_string,
output_file_directive, botch): Likewise.
* tree.h (make_decl_rtl): Likewise.
* varasm.c (strip_reg_name, named_section, decode_reg_name,
make_decl_rtl): Likewise.
From-SVN: r24743
1999-01-18 09:53:41 +01:00
const char * name ;
1998-07-13 19:20:29 +02:00
int value ;
cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
* cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
Instead of writing to const char *buf directly, use a non-const
variable `wbuf' to allocate and write a string, then set buf = wbuf.
* cppulp.c (user_label_prefix): Qualify a char* with the `const'
keyword.
* dyn-string.c (dyn_string_append): Likewise.
* dyn-string.h (dyn_string_append): Likewise.
* final.c (end_final, output_operand_lossage, asm_fprintf): Likewise.
* output.h (end_final, output_operand_lossage, asm_fprintf,
named_section, decode_reg_name, make_decl_rtl, user_label_prefix):
Likewise.
* profile.c (init_branch_prob): Likewise.
* toplev.c (set_target_switch, vmessage,
v_message_with_file_and_line, v_message_with_decl,
v_error_with_file_and_line, v_error_with_decl, v_error_for_asm,
verror, vfatal, v_warning_with_file_and_line, v_warning_with_decl,
v_warning_for_asm, vwarning, vpedwarn, v_pedwarn_with_decl,
v_pedwarn_with_file_and_line, vsorry, v_really_sorry,
open_dump_file, dump_rtl, clean_dump_file,
print_version, print_single_switch, print_switch_values,
dump_base_name, debug_args, lang_independent_options,
user_label_prefix, documented_lang_options, target_switches,
target_options, print_time, pfatal_with_name, fatal_io_error,
fatal_insn, default_print_error_function, print_error_function,
report_error_function, error_with_file_and_line, error_with_decl,
error_for_asm, error, fatal, warning_with_file_and_line,
warning_with_decl, warning_for_asm, warning, pedwarn,
pedwarn_with_decl, pedwarn_with_file_and_line, sorry,
really_sorry, botch, output_quoted_string, output_file_directive,
open_dump_file, rest_of_decl_compilation, display_help, main):
Likewise.
* toplev.h (print_time, fatal, fatal_io_error, pfatal_with_name,
fatal_insn, warning, error, pedwarn, pedwarn_with_file_and_line,
warning_with_file_and_line, error_with_file_and_line, sorry,
really_sorry, default_print_error_function, report_error_function,
rest_of_decl_compilation, pedwarn_with_decl, warning_with_decl,
error_with_decl, error_for_asm, warning_for_asm, output_quoted_string,
output_file_directive, botch): Likewise.
* tree.h (make_decl_rtl): Likewise.
* varasm.c (strip_reg_name, named_section, decode_reg_name,
make_decl_rtl): Likewise.
From-SVN: r24743
1999-01-18 09:53:41 +01:00
const char * description ;
1998-07-13 19:20:29 +02:00
}
target_switches [ ] = TARGET_SWITCHES ;
/* This table is similar, but allows the switch to have a value. */
# ifdef TARGET_OPTIONS
struct
{
cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
* cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
Instead of writing to const char *buf directly, use a non-const
variable `wbuf' to allocate and write a string, then set buf = wbuf.
* cppulp.c (user_label_prefix): Qualify a char* with the `const'
keyword.
* dyn-string.c (dyn_string_append): Likewise.
* dyn-string.h (dyn_string_append): Likewise.
* final.c (end_final, output_operand_lossage, asm_fprintf): Likewise.
* output.h (end_final, output_operand_lossage, asm_fprintf,
named_section, decode_reg_name, make_decl_rtl, user_label_prefix):
Likewise.
* profile.c (init_branch_prob): Likewise.
* toplev.c (set_target_switch, vmessage,
v_message_with_file_and_line, v_message_with_decl,
v_error_with_file_and_line, v_error_with_decl, v_error_for_asm,
verror, vfatal, v_warning_with_file_and_line, v_warning_with_decl,
v_warning_for_asm, vwarning, vpedwarn, v_pedwarn_with_decl,
v_pedwarn_with_file_and_line, vsorry, v_really_sorry,
open_dump_file, dump_rtl, clean_dump_file,
print_version, print_single_switch, print_switch_values,
dump_base_name, debug_args, lang_independent_options,
user_label_prefix, documented_lang_options, target_switches,
target_options, print_time, pfatal_with_name, fatal_io_error,
fatal_insn, default_print_error_function, print_error_function,
report_error_function, error_with_file_and_line, error_with_decl,
error_for_asm, error, fatal, warning_with_file_and_line,
warning_with_decl, warning_for_asm, warning, pedwarn,
pedwarn_with_decl, pedwarn_with_file_and_line, sorry,
really_sorry, botch, output_quoted_string, output_file_directive,
open_dump_file, rest_of_decl_compilation, display_help, main):
Likewise.
* toplev.h (print_time, fatal, fatal_io_error, pfatal_with_name,
fatal_insn, warning, error, pedwarn, pedwarn_with_file_and_line,
warning_with_file_and_line, error_with_file_and_line, sorry,
really_sorry, default_print_error_function, report_error_function,
rest_of_decl_compilation, pedwarn_with_decl, warning_with_decl,
error_with_decl, error_for_asm, warning_for_asm, output_quoted_string,
output_file_directive, botch): Likewise.
* tree.h (make_decl_rtl): Likewise.
* varasm.c (strip_reg_name, named_section, decode_reg_name,
make_decl_rtl): Likewise.
From-SVN: r24743
1999-01-18 09:53:41 +01:00
const char * prefix ;
const char * * variable ;
const char * description ;
1998-07-13 19:20:29 +02:00
}
target_options [ ] = TARGET_OPTIONS ;
# endif
1992-02-06 00:20:23 +01:00
/* Options controlling warnings */
/* Don't print warning messages. -w. */
int inhibit_warnings = 0 ;
/* Print various extra warnings. -W. */
int extra_warnings = 0 ;
/* Treat warnings as errors. -Werror. */
int warnings_are_errors = 0 ;
/* Nonzero to warn about unused local variables. */
int warn_unused ;
1999-08-18 12:43:26 +02:00
/* Nonzero to warn about code which is never reached. */
int warn_notreached ;
1992-02-06 00:20:23 +01:00
/* Nonzero to warn about variables used before they are initialized. */
int warn_uninitialized ;
/* Nonzero means warn about all declarations which shadow others. */
int warn_shadow ;
/* Warn if a switch on an enum fails to have a case for every enum value. */
int warn_switch ;
/* Nonzero means warn about function definitions that default the return type
or that use a null return and have a return - type other than void . */
int warn_return_type ;
/* Nonzero means warn about pointer casts that increase the required
alignment of the target type ( and might therefore lead to a crash
due to a misaligned access ) . */
int warn_cast_align ;
/* Nonzero means warn about any identifiers that match in the first N
characters . The value N is in ` id_clash_len ' . */
int warn_id_clash ;
1994-02-27 21:19:23 +01:00
unsigned id_clash_len ;
/* Nonzero means warn about any objects definitions whose size is larger
than N bytes . Also want about function definitions whose returned
values are larger than N bytes . The value N is in ` larger_than_size ' . */
int warn_larger_than ;
unsigned larger_than_size ;
1992-02-06 00:20:23 +01:00
/* Nonzero means warn if inline function is too large. */
int warn_inline ;
/* Warn if a function returns an aggregate,
since there are often incompatible calling conventions for doing this . */
int warn_aggregate_return ;
1999-12-03 20:02:20 +01:00
/* Warn if packed attribute on struct is unnecessary and inefficient. */
int warn_packed ;
/* Warn when gcc pads a structure to an alignment boundary. */
int warn_padded ;
1992-02-06 00:20:23 +01:00
/* Likewise for -W. */
1998-07-13 19:20:29 +02:00
lang_independent_options W_options [ ] =
1992-02-06 00:20:23 +01:00
{
1998-07-13 19:20:29 +02:00
{ " unused " , & warn_unused , 1 , " Warn when a variable is unused " } ,
{ " error " , & warnings_are_errors , 1 , " " } ,
{ " shadow " , & warn_shadow , 1 , " Warn when one local variable shadows another " } ,
{ " switch " , & warn_switch , 1 ,
" Warn about enumerated switches missing a specific case " } ,
{ " aggregate-return " , & warn_aggregate_return , 1 ,
" Warn about returning structures, unions or arrays " } ,
{ " cast-align " , & warn_cast_align , 1 ,
" Warn about pointer casts which increase alignment " } ,
1999-08-18 12:43:26 +02:00
{ " unreachable-code " , & warn_notreached , 1 ,
" Warn about code that will never be executed " } ,
1998-07-13 19:20:29 +02:00
{ " uninitialized " , & warn_uninitialized , 1 ,
" Warn about unitialized automatic variables " } ,
{ " inline " , & warn_inline , 1 ,
1999-12-03 20:02:20 +01:00
" Warn when an inlined function cannot be inlined " } ,
{ " packed " , & warn_packed , 1 ,
" Warn when the packed attribute has no effect on struct layout " } ,
{ " padded " , & warn_padded , 1 ,
" Warn when padding is required to align struct members " }
1992-02-06 00:20:23 +01:00
} ;
/* Output files for assembler code (real compiler output)
and debugging dumps . */
FILE * asm_out_file ;
FILE * aux_info_file ;
1998-01-26 23:48:32 +01:00
FILE * rtl_dump_file = NULL ;
1992-02-06 00:20:23 +01:00
1999-02-02 22:43:19 +01:00
/* Decode the string P as an integral parameter.
If the string is indeed an integer return its numeric value else
1999-03-19 02:01:01 +01:00
issue an Invalid Option error for the option PNAME and return DEFVAL .
If PNAME is zero just return DEFVAL , do not call error . */
1999-02-02 22:43:19 +01:00
int
read_integral_parameter ( p , pname , defval )
1999-03-19 02:01:01 +01:00
const char * p ;
const char * pname ;
const int defval ;
1999-02-02 22:43:19 +01:00
{
1999-03-19 02:01:01 +01:00
const char * endp = p ;
1999-02-02 22:43:19 +01:00
while ( * endp )
{
if ( * endp > = ' 0 ' & & * endp < = ' 9 ' )
endp + + ;
else
1999-03-19 02:01:01 +01:00
break ;
}
if ( * endp ! = 0 )
{
if ( pname ! = 0 )
error ( " Invalid option `%s' " , pname ) ;
return defval ;
1999-02-02 22:43:19 +01:00
}
return atoi ( p ) ;
}
1992-02-06 00:20:23 +01:00
/* Time accumulators, to count the total time spent in various passes. */
int parse_time ;
int varconst_time ;
int integration_time ;
int jump_time ;
int cse_time ;
1998-05-20 02:24:32 +02:00
int gcse_time ;
1992-02-06 00:20:23 +01:00
int loop_time ;
int cse2_time ;
1997-03-28 23:40:07 +01:00
int branch_prob_time ;
1992-02-06 00:20:23 +01:00
int flow_time ;
int combine_time ;
1997-08-12 06:07:19 +02:00
int regmove_time ;
1992-02-06 00:20:23 +01:00
int sched_time ;
int local_alloc_time ;
int global_alloc_time ;
1999-02-26 00:45:42 +01:00
int flow2_time ;
1999-10-05 06:04:48 +02:00
int peephole2_time ;
1992-02-06 00:20:23 +01:00
int sched2_time ;
int dbr_sched_time ;
int shorten_branch_time ;
int stack_reg_time ;
int final_time ;
int symout_time ;
int dump_time ;
1999-09-04 20:25:41 +02:00
int gc_time ;
int all_time ;
1992-02-06 00:20:23 +01:00
/* Return time used so far, in microseconds. */
1998-11-27 11:09:17 +01:00
long
1992-02-06 00:20:23 +01:00
get_run_time ( )
{
if ( quiet_flag )
return 0 ;
1998-01-25 23:14:54 +01:00
1997-12-12 09:50:19 +01:00
# ifdef __BEOS__
return 0 ;
# else /* not BeOS */
1998-11-12 20:37:47 +01:00
# if defined (_WIN32) && !defined (__CYGWIN__)
1995-02-22 00:57:45 +01:00
if ( clock ( ) < 0 )
return 0 ;
else
return ( clock ( ) * 1000 ) ;
1995-05-17 00:36:33 +02:00
# else /* not _WIN32 */
1998-01-23 00:26:28 +01:00
# ifdef _SC_CLK_TCK
{
static int tick ;
1998-01-25 23:14:54 +01:00
struct tms tms ;
1998-01-23 00:26:28 +01:00
if ( tick = = 0 )
tick = 1000000 / sysconf ( _SC_CLK_TCK ) ;
times ( & tms ) ;
return ( tms . tms_utime + tms . tms_stime ) * tick ;
}
# else
1992-02-06 00:20:23 +01:00
# ifdef USG
1998-01-25 23:14:54 +01:00
{
struct tms tms ;
1998-04-04 15:32:39 +02:00
# if HAVE_SYSCONF && defined _SC_CLK_TCK
# define TICKS_PER_SECOND sysconf (_SC_CLK_TCK) /* POSIX 1003.1-1996 */
# else
# ifdef CLK_TCK
# define TICKS_PER_SECOND CLK_TCK /* POSIX 1003.1-1988; obsolescent */
# else
# define TICKS_PER_SECOND HZ /* traditional UNIX */
# endif
# endif
1998-01-25 23:14:54 +01:00
times ( & tms ) ;
1998-04-04 15:32:39 +02:00
return ( tms . tms_utime + tms . tms_stime ) * ( 1000000 / TICKS_PER_SECOND ) ;
1998-01-25 23:14:54 +01:00
}
1992-02-06 00:20:23 +01:00
# else
# ifndef VMS
1998-01-25 23:14:54 +01:00
{
struct rusage rusage ;
getrusage ( 0 , & rusage ) ;
return ( rusage . ru_utime . tv_sec * 1000000 + rusage . ru_utime . tv_usec
+ rusage . ru_stime . tv_sec * 1000000 + rusage . ru_stime . tv_usec ) ;
}
1992-02-06 00:20:23 +01:00
# else /* VMS */
1998-01-25 23:14:54 +01:00
{
struct
{
int proc_user_time ;
int proc_system_time ;
int child_user_time ;
int child_system_time ;
} vms_times ;
times ( ( void * ) & vms_times ) ;
return ( vms_times . proc_user_time + vms_times . proc_system_time ) * 10000 ;
}
1997-12-12 07:36:11 +01:00
# endif /* VMS */
# endif /* USG */
1998-01-23 00:26:28 +01:00
# endif /* _SC_CLK_TCK */
1997-12-12 07:36:11 +01:00
# endif /* _WIN32 */
# endif /* __BEOS__ */
1992-02-06 00:20:23 +01:00
}
# define TIMEVAR(VAR, BODY) \
do { int otime = get_run_time ( ) ; BODY ; VAR + = get_run_time ( ) - otime ; } while ( 0 )
void
print_time ( str , total )
cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
* cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
Instead of writing to const char *buf directly, use a non-const
variable `wbuf' to allocate and write a string, then set buf = wbuf.
* cppulp.c (user_label_prefix): Qualify a char* with the `const'
keyword.
* dyn-string.c (dyn_string_append): Likewise.
* dyn-string.h (dyn_string_append): Likewise.
* final.c (end_final, output_operand_lossage, asm_fprintf): Likewise.
* output.h (end_final, output_operand_lossage, asm_fprintf,
named_section, decode_reg_name, make_decl_rtl, user_label_prefix):
Likewise.
* profile.c (init_branch_prob): Likewise.
* toplev.c (set_target_switch, vmessage,
v_message_with_file_and_line, v_message_with_decl,
v_error_with_file_and_line, v_error_with_decl, v_error_for_asm,
verror, vfatal, v_warning_with_file_and_line, v_warning_with_decl,
v_warning_for_asm, vwarning, vpedwarn, v_pedwarn_with_decl,
v_pedwarn_with_file_and_line, vsorry, v_really_sorry,
open_dump_file, dump_rtl, clean_dump_file,
print_version, print_single_switch, print_switch_values,
dump_base_name, debug_args, lang_independent_options,
user_label_prefix, documented_lang_options, target_switches,
target_options, print_time, pfatal_with_name, fatal_io_error,
fatal_insn, default_print_error_function, print_error_function,
report_error_function, error_with_file_and_line, error_with_decl,
error_for_asm, error, fatal, warning_with_file_and_line,
warning_with_decl, warning_for_asm, warning, pedwarn,
pedwarn_with_decl, pedwarn_with_file_and_line, sorry,
really_sorry, botch, output_quoted_string, output_file_directive,
open_dump_file, rest_of_decl_compilation, display_help, main):
Likewise.
* toplev.h (print_time, fatal, fatal_io_error, pfatal_with_name,
fatal_insn, warning, error, pedwarn, pedwarn_with_file_and_line,
warning_with_file_and_line, error_with_file_and_line, sorry,
really_sorry, default_print_error_function, report_error_function,
rest_of_decl_compilation, pedwarn_with_decl, warning_with_decl,
error_with_decl, error_for_asm, warning_for_asm, output_quoted_string,
output_file_directive, botch): Likewise.
* tree.h (make_decl_rtl): Likewise.
* varasm.c (strip_reg_name, named_section, decode_reg_name,
make_decl_rtl): Likewise.
From-SVN: r24743
1999-01-18 09:53:41 +01:00
const char * str ;
1992-02-06 00:20:23 +01:00
int total ;
{
fprintf ( stderr ,
1999-09-04 20:25:41 +02:00
" time in %s: %d.%06d (%.0f%%) \n " ,
str , total / 1000000 , total % 1000000 ,
( double ) total / ( double ) all_time * 100.0 ) ;
1992-02-06 00:20:23 +01:00
}
/* This is the default decl_printable_name function. */
1999-08-29 15:41:25 +02:00
static const char *
1997-02-16 11:05:43 +01:00
decl_name ( decl , verbosity )
1992-02-06 00:20:23 +01:00
tree decl ;
Makefile.in (toplev.o): Depend on $(EXPR_H).
* Makefile.in (toplev.o): Depend on $(EXPR_H).
(insn-extract.o, insn-attrtab.o): Depend on toplev.h.
* gansidecl.h: Define ATTRIBUTE_NORETURN.
* genattrtab.c: Have insn-attrtab.c include toplev.h.
* genextract.c: Have insn-extract.c include toplev.h.
* rtl.h: Don't prototype `fatal_insn_not_found' and `fatal_insn'.
* toplev.c: Include expr.h.
(really_sorry, fancy_abort): Remove prototypes.
(set_target_switch): Add argument in prototype.
(vfatal): Mark prototype with ATTRIBUTE_NORETURN.
(v_really_sorry): Likewise.
(print_version, print_single_switch, print_switch_values): Make
static and add prototype arguments.
(decl_printable_name): Add prototype arguments.
(lang_expand_expr_t): New typedef.
(lang_expand_expr): Declare as a lang_expand_expr_t.
(incomplete_decl_finalize_hook): Add prototype argument.
(decl_name): Mark variable `verbosity' with ATTRIBUTE_UNUSED.
(botch): Likewise for variable `s'.
(rest_of_type_compilation): Mark variables `type' and `toplev'
with ATTRIBUTE_UNUSED if none of DBX_DEBUGGING_INFO,
XCOFF_DEBUGGING_INFO or SDB_DEBUGGING_INFO are defined.
(display_help): Make variable `i' an `unsigned long'.
(main): Remove unused parameter `envp'.
Cast assignment to `lang_expand_expr' to a `lang_expand_expr_t'.
Cast -1 when comparing it with a `size_t'.
* toplev.h (fatal, fatal_io_error, pfatal_with_name): Mark
prototype with ATTRIBUTE_NORETURN.
(fatal_insn_not_found, fatal_insn, really_sorry,
push_float_handler, pop_float_handler): Add prototypes.
(fancy_abort): Mark prototype with ATTRIBUTE_NORETURN.
(do_abort, botch): Add prototypes.
From-SVN: r22293
1998-09-06 07:56:20 +02:00
int verbosity ATTRIBUTE_UNUSED ;
1992-02-06 00:20:23 +01:00
{
return IDENTIFIER_POINTER ( DECL_NAME ( decl ) ) ;
}
1999-09-07 12:10:01 +02:00
/* Mark P for GC. Also mark main_input_filename and input_filename. */
static void
mark_file_stack ( p )
void * p ;
{
struct file_stack * stack = * ( struct file_stack * * ) p ;
/* We're only called for input_file_stack, so we can mark the current
input_filename here as well . */
ggc_mark_string ( main_input_filename ) ;
ggc_mark_string ( input_filename ) ;
while ( stack )
{
ggc_mark_string ( stack - > name ) ;
stack = stack - > next ;
}
}
1992-02-06 00:20:23 +01:00
/* This calls abort and is used to avoid problems when abort if a macro.
It is used when we need to pass the address of abort . */
void
do_abort ( )
{
abort ( ) ;
}
/* When `malloc.c' is compiled with `rcheck' defined,
it calls this function to report clobberage . */
void
botch ( s )
cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
* cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
Instead of writing to const char *buf directly, use a non-const
variable `wbuf' to allocate and write a string, then set buf = wbuf.
* cppulp.c (user_label_prefix): Qualify a char* with the `const'
keyword.
* dyn-string.c (dyn_string_append): Likewise.
* dyn-string.h (dyn_string_append): Likewise.
* final.c (end_final, output_operand_lossage, asm_fprintf): Likewise.
* output.h (end_final, output_operand_lossage, asm_fprintf,
named_section, decode_reg_name, make_decl_rtl, user_label_prefix):
Likewise.
* profile.c (init_branch_prob): Likewise.
* toplev.c (set_target_switch, vmessage,
v_message_with_file_and_line, v_message_with_decl,
v_error_with_file_and_line, v_error_with_decl, v_error_for_asm,
verror, vfatal, v_warning_with_file_and_line, v_warning_with_decl,
v_warning_for_asm, vwarning, vpedwarn, v_pedwarn_with_decl,
v_pedwarn_with_file_and_line, vsorry, v_really_sorry,
open_dump_file, dump_rtl, clean_dump_file,
print_version, print_single_switch, print_switch_values,
dump_base_name, debug_args, lang_independent_options,
user_label_prefix, documented_lang_options, target_switches,
target_options, print_time, pfatal_with_name, fatal_io_error,
fatal_insn, default_print_error_function, print_error_function,
report_error_function, error_with_file_and_line, error_with_decl,
error_for_asm, error, fatal, warning_with_file_and_line,
warning_with_decl, warning_for_asm, warning, pedwarn,
pedwarn_with_decl, pedwarn_with_file_and_line, sorry,
really_sorry, botch, output_quoted_string, output_file_directive,
open_dump_file, rest_of_decl_compilation, display_help, main):
Likewise.
* toplev.h (print_time, fatal, fatal_io_error, pfatal_with_name,
fatal_insn, warning, error, pedwarn, pedwarn_with_file_and_line,
warning_with_file_and_line, error_with_file_and_line, sorry,
really_sorry, default_print_error_function, report_error_function,
rest_of_decl_compilation, pedwarn_with_decl, warning_with_decl,
error_with_decl, error_for_asm, warning_for_asm, output_quoted_string,
output_file_directive, botch): Likewise.
* tree.h (make_decl_rtl): Likewise.
* varasm.c (strip_reg_name, named_section, decode_reg_name,
make_decl_rtl): Likewise.
From-SVN: r24743
1999-01-18 09:53:41 +01:00
const char * s ATTRIBUTE_UNUSED ;
1992-02-06 00:20:23 +01:00
{
abort ( ) ;
}
/* Return the logarithm of X, base 2, considering X unsigned,
1992-07-06 22:14:57 +02:00
if X is a power of 2. Otherwise , returns - 1.
This should be used via the ` exact_log2 ' macro . */
1992-02-06 00:20:23 +01:00
int
1992-07-06 22:14:57 +02:00
exact_log2_wide ( x )
register unsigned HOST_WIDE_INT x ;
1992-02-06 00:20:23 +01:00
{
register int log = 0 ;
/* Test for 0 or a power of 2. */
if ( x = = 0 | | x ! = ( x & - x ) )
return - 1 ;
while ( ( x > > = 1 ) ! = 0 )
log + + ;
return log ;
}
/* Given X, an unsigned number, return the largest int Y such that 2**Y <= X.
1992-07-06 22:14:57 +02:00
If X is 0 , return - 1.
This should be used via the floor_log2 macro . */
1992-02-06 00:20:23 +01:00
int
1992-07-06 22:14:57 +02:00
floor_log2_wide ( x )
register unsigned HOST_WIDE_INT x ;
1992-02-06 00:20:23 +01:00
{
register int log = - 1 ;
while ( x ! = 0 )
log + + ,
x > > = 1 ;
return log ;
}
1997-01-20 03:19:04 +01:00
static int float_handler_set ;
1992-02-06 00:20:23 +01:00
int float_handled ;
jmp_buf float_handler ;
1997-01-20 03:19:04 +01:00
/* Signals actually come here. */
static void
float_signal ( signo )
/* If this is missing, some compilers complain. */
Warning fixes:
* Makefile.in (c-lang.o): Depend on c-tree.h, c-lex.h and toplev.h.
(c-lex.o): Depend on output.h.
(c-common.o): Likewise.
(stmt.o): Likewise.
(calls.o): Likewise.
(integrate.o): Depend on toplev.h.
(regclass.o): Depend on output.h.
(final.o): Depend on reload.h.
* c-common.c: Include output.h.
(check_format_info): Remove unused variable `integral_format'.
* c-decl.c (print_lang_decl): Mark parameters `file', `node' and
`indent' with ATTRIBUTE_UNUSED.
(print_lang_type): Likewise.
(maybe_build_cleanup): Likewise for parameter `decl'.
(copy_lang_decl): Likewise for parameter `node'.
* c-lang.c: Include c-tree.h, c-lex.h and toplev.h.
(lang_print_xnode): Mark parameters `file', `node' and `indent'
with ATTRIBUTE_UNUSED.
(lookup_interface): Likewise for parameter `arg'.
(is_class_name): Likewise.
(maybe_objc_check_decl): Likewise for parameter `decl'.
(maybe_objc_comptypes): Likewise for parameters `lhs', `rhs' and
`reflexive'.
(maybe_objc_method_name): Likewise for parameter `decl'.
(build_objc_string): Likewise for parameters `len' and `str'.
* c-lex.c: Include output.h.
* c-lex.h (position_after_white_space): Correct typo in prototype.
* c-tree.h (finish_file, c_expand_start_cond, c_expand_start_else,
c_expand_end_cond, init_iterators): Add prototypes.
* caller-save.c (set_reg_live): Mark parameters `reg' and `setter'
with ATTRIBUTE_UNUSED.
* calls.c: Include output.h.
* cccp.c (pipe_closed): Mark parameter `signo' with
ATTRIBUTE_UNUSED.
* combine.c: Move inclusion of expr.h to after insn-config.h.
* iris6.h (ASM_IDENTIFY_GCC, ASM_IDENTIFY_LANGUAGE): Don't define
as empty, rather define as ((void)0).
* sparc.c (sparc_check_64): Add braces around ambiguous `else'.
Add parentheses around assignment used as truth value.
* cplus-dem.c (squangle_mop_up): Change return type to void.
(internal_cplus_demangle): Remove unused parameter `options'.
All callers changed.
(cplus_demangle_opname): Remove function wide variable `int i' and
replace with `size_t i' at each location where it is used.
(cplus_demangle_opname): change type of `i' from int to size_t.
* cppexp.c (right_shift): Mark parameter `pfile' with
ATTRIBUTE_UNUSED.
* cpphash.c (cpp_lookup): Likewise.
(cpp_hash_cleanup): Likewise.
* cpplib.c (parse_name): Add a prototype and make it static.
(null_underflow): Mark parameter `pfile' with ATTRIBUTE_UNUSED.
(null_cleanup): Likewise for parameters `pbuf' and `pfile'.
(macro_cleanup): Likewise for parameter `pfile'.
(file_cleanup): Likewise.
* cpplib.h (cpp_reader_init, cpp_options_init, cpp_start_read,
cpp_read_check_assertion, skip_rest_of_line): Add prototypes.
* crtstuff.c (force_to_data, __CTOR_LIST__, force_to_data,
__DTOR_END__, __FRAME_END__): Mark with ATTRIBUTE_UNUSED.
* cse.c (cse_check_loop_start): Mark parameter `set' with
ATTRIBUTE_UNUSED.
* dbxout.c (flag_minimal_debug, have_used_extensions,
source_label_number): Move inside macro wrapper check against
defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO).
* dwarf2out.c (gen_entry_point_die): Hide prototype and definition.
* except.h (doing_eh): Provide prototype.
* expr.c: Move inclusion of expr.h to after insn-config.h.
* final.c: Include reload.h.
(shorten_branches): Cast the first argument of bzero to char *.
* fix-header.c (cpp_print_containing_files): Mark parameter
`pfile' with ATTRIBUTE_UNUSED.
(cpp_fatal): Likewise.
* flow.c (find_basic_blocks_1): Cast the first argument of bzero
to char *.
* genattrtab.c (make_length_attrs): Change the type of variable
`i' from int to size_t.
(zero_fn): Mark parameter `exp' with ATTRIBUTE_UNUSED.
(one_fn): Likewise.
* genextract.c (main): When generating insn-extract.c, mark
variable `junk' with ATTRIBUTE_UNUSED.
* gengenrtl.c (gencode): When generating genrtl.c, cast the first
argument of bzero to char*.
* integrate.c: Include toplev.h.
* libgcc2.c: Wrap `struct exception_table' and
`find_exception_handler' in macro DWARF2_UNWIND_INFO.
* objc/Make-lang.in (objc-act.o): Depend on toplev.h.
* objc/objc-act.c: Include toplev.h.
(lang_print_xnode): Mark parameters `file', `node' and `indent'
with ATTRIBUTE_UNUSED.
(finish_protocol): Likewise for parameter `protocol'.
* output.h (declare_weak): Add prototype.
(decode_reg_name): Don't wrap with TREE_CODE macro.
(assemble_alias): Add prototype.
* regclass.c: Include output.h.
* reload.h (reloads_conflict): Add prototype.
* rtl.h (print_rtl_single, mark_elimiation, reg_class_subset_p,
output_func_start_profiler): Add prototypes.
* rtlanal.c (reg_set_p_1): Mark parameters `x' and `pat' with
ATTRIBUTE_UNUSED.
* scan-decls.c: Include scan.h.
* scan.h (recognized_function, recognized_extern): Add prototypes.
* stmt.c: Include output.h.
* toplev.c (error_for_asm, warning_for_asm): Remove prototypes.
(output_lang_identify): Hide prototype and definition.
(float_signal): Mark parameter `signo' with ATTRIBUTE_UNUSED.
(pipe_closed): Likewise.
* toplev.h (count_error, strip_off_ending, error_for_asm,
warning_for_asm): Add prototypes.
From-SVN: r19712
1998-05-13 14:40:39 +02:00
int signo ATTRIBUTE_UNUSED ;
1997-01-20 03:19:04 +01:00
{
if ( float_handled = = 0 )
abort ( ) ;
# if defined (USG) || defined (hpux)
signal ( SIGFPE , float_signal ) ; /* re-enable the signal catcher */
# endif
float_handled = 0 ;
signal ( SIGFPE , float_signal ) ;
longjmp ( float_handler , 1 ) ;
}
1992-02-06 00:20:23 +01:00
/* Specify where to longjmp to when a floating arithmetic error happens.
If HANDLER is 0 , it means don ' t handle the errors any more . */
void
set_float_handler ( handler )
jmp_buf handler ;
{
float_handled = ( handler ! = 0 ) ;
if ( handler )
1994-06-15 00:19:28 +02:00
bcopy ( ( char * ) handler , ( char * ) float_handler , sizeof ( float_handler ) ) ;
1997-01-20 03:19:04 +01:00
if ( float_handled & & ! float_handler_set )
{
signal ( SIGFPE , float_signal ) ;
float_handler_set = 1 ;
}
1992-02-06 00:20:23 +01:00
}
1999-03-14 15:02:10 +01:00
/* This is a wrapper function for code which might elicit an
arithmetic exception . That code should be passed in as a function
pointer FN , and one argument DATA . DATA is usually a struct which
contains the real input and output for function FN . This function
returns 0 ( failure ) if longjmp was called ( i . e . an exception
occured . ) It returns 1 ( success ) otherwise . */
int
do_float_handler ( fn , data )
2000-01-17 16:55:18 +01:00
void ( * fn ) PARAMS ( ( PTR ) ) ;
1999-03-14 15:02:10 +01:00
PTR data ;
{
jmp_buf buf ;
if ( setjmp ( buf ) )
{
/* We got here via longjmp() caused by an exception in function fn() */
set_float_handler ( NULL ) ;
return 0 ;
}
set_float_handler ( buf ) ;
( * fn ) ( data ) ;
set_float_handler ( NULL ) ;
return 1 ;
}
1992-10-21 22:20:41 +01:00
/* Specify, in HANDLER, where to longjmp to when a floating arithmetic
error happens , pushing the previous specification into OLD_HANDLER .
Return an indication of whether there was a previous handler in effect . */
int
push_float_handler ( handler , old_handler )
1992-10-23 10:51:12 +01:00
jmp_buf handler , old_handler ;
1992-10-21 22:20:41 +01:00
{
int was_handled = float_handled ;
float_handled = 1 ;
if ( was_handled )
1998-09-21 01:54:10 +02:00
memcpy ( ( char * ) old_handler , ( char * ) float_handler ,
1994-06-15 00:19:28 +02:00
sizeof ( float_handler ) ) ;
1998-09-21 01:54:10 +02:00
memcpy ( ( char * ) float_handler , ( char * ) handler , sizeof ( float_handler ) ) ;
1992-10-21 22:20:41 +01:00
return was_handled ;
}
/* Restore the previous specification of whether and where to longjmp to
when a floating arithmetic error happens . */
void
pop_float_handler ( handled , handler )
int handled ;
jmp_buf handler ;
{
float_handled = handled ;
if ( handled )
1994-06-15 00:19:28 +02:00
bcopy ( ( char * ) handler , ( char * ) float_handler , sizeof ( float_handler ) ) ;
1992-10-21 22:20:41 +01:00
}
1992-02-06 00:20:23 +01:00
/* Handler for SIGPIPE. */
static void
pipe_closed ( signo )
/* If this is missing, some compilers complain. */
Warning fixes:
* Makefile.in (c-lang.o): Depend on c-tree.h, c-lex.h and toplev.h.
(c-lex.o): Depend on output.h.
(c-common.o): Likewise.
(stmt.o): Likewise.
(calls.o): Likewise.
(integrate.o): Depend on toplev.h.
(regclass.o): Depend on output.h.
(final.o): Depend on reload.h.
* c-common.c: Include output.h.
(check_format_info): Remove unused variable `integral_format'.
* c-decl.c (print_lang_decl): Mark parameters `file', `node' and
`indent' with ATTRIBUTE_UNUSED.
(print_lang_type): Likewise.
(maybe_build_cleanup): Likewise for parameter `decl'.
(copy_lang_decl): Likewise for parameter `node'.
* c-lang.c: Include c-tree.h, c-lex.h and toplev.h.
(lang_print_xnode): Mark parameters `file', `node' and `indent'
with ATTRIBUTE_UNUSED.
(lookup_interface): Likewise for parameter `arg'.
(is_class_name): Likewise.
(maybe_objc_check_decl): Likewise for parameter `decl'.
(maybe_objc_comptypes): Likewise for parameters `lhs', `rhs' and
`reflexive'.
(maybe_objc_method_name): Likewise for parameter `decl'.
(build_objc_string): Likewise for parameters `len' and `str'.
* c-lex.c: Include output.h.
* c-lex.h (position_after_white_space): Correct typo in prototype.
* c-tree.h (finish_file, c_expand_start_cond, c_expand_start_else,
c_expand_end_cond, init_iterators): Add prototypes.
* caller-save.c (set_reg_live): Mark parameters `reg' and `setter'
with ATTRIBUTE_UNUSED.
* calls.c: Include output.h.
* cccp.c (pipe_closed): Mark parameter `signo' with
ATTRIBUTE_UNUSED.
* combine.c: Move inclusion of expr.h to after insn-config.h.
* iris6.h (ASM_IDENTIFY_GCC, ASM_IDENTIFY_LANGUAGE): Don't define
as empty, rather define as ((void)0).
* sparc.c (sparc_check_64): Add braces around ambiguous `else'.
Add parentheses around assignment used as truth value.
* cplus-dem.c (squangle_mop_up): Change return type to void.
(internal_cplus_demangle): Remove unused parameter `options'.
All callers changed.
(cplus_demangle_opname): Remove function wide variable `int i' and
replace with `size_t i' at each location where it is used.
(cplus_demangle_opname): change type of `i' from int to size_t.
* cppexp.c (right_shift): Mark parameter `pfile' with
ATTRIBUTE_UNUSED.
* cpphash.c (cpp_lookup): Likewise.
(cpp_hash_cleanup): Likewise.
* cpplib.c (parse_name): Add a prototype and make it static.
(null_underflow): Mark parameter `pfile' with ATTRIBUTE_UNUSED.
(null_cleanup): Likewise for parameters `pbuf' and `pfile'.
(macro_cleanup): Likewise for parameter `pfile'.
(file_cleanup): Likewise.
* cpplib.h (cpp_reader_init, cpp_options_init, cpp_start_read,
cpp_read_check_assertion, skip_rest_of_line): Add prototypes.
* crtstuff.c (force_to_data, __CTOR_LIST__, force_to_data,
__DTOR_END__, __FRAME_END__): Mark with ATTRIBUTE_UNUSED.
* cse.c (cse_check_loop_start): Mark parameter `set' with
ATTRIBUTE_UNUSED.
* dbxout.c (flag_minimal_debug, have_used_extensions,
source_label_number): Move inside macro wrapper check against
defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO).
* dwarf2out.c (gen_entry_point_die): Hide prototype and definition.
* except.h (doing_eh): Provide prototype.
* expr.c: Move inclusion of expr.h to after insn-config.h.
* final.c: Include reload.h.
(shorten_branches): Cast the first argument of bzero to char *.
* fix-header.c (cpp_print_containing_files): Mark parameter
`pfile' with ATTRIBUTE_UNUSED.
(cpp_fatal): Likewise.
* flow.c (find_basic_blocks_1): Cast the first argument of bzero
to char *.
* genattrtab.c (make_length_attrs): Change the type of variable
`i' from int to size_t.
(zero_fn): Mark parameter `exp' with ATTRIBUTE_UNUSED.
(one_fn): Likewise.
* genextract.c (main): When generating insn-extract.c, mark
variable `junk' with ATTRIBUTE_UNUSED.
* gengenrtl.c (gencode): When generating genrtl.c, cast the first
argument of bzero to char*.
* integrate.c: Include toplev.h.
* libgcc2.c: Wrap `struct exception_table' and
`find_exception_handler' in macro DWARF2_UNWIND_INFO.
* objc/Make-lang.in (objc-act.o): Depend on toplev.h.
* objc/objc-act.c: Include toplev.h.
(lang_print_xnode): Mark parameters `file', `node' and `indent'
with ATTRIBUTE_UNUSED.
(finish_protocol): Likewise for parameter `protocol'.
* output.h (declare_weak): Add prototype.
(decode_reg_name): Don't wrap with TREE_CODE macro.
(assemble_alias): Add prototype.
* regclass.c: Include output.h.
* reload.h (reloads_conflict): Add prototype.
* rtl.h (print_rtl_single, mark_elimiation, reg_class_subset_p,
output_func_start_profiler): Add prototypes.
* rtlanal.c (reg_set_p_1): Mark parameters `x' and `pat' with
ATTRIBUTE_UNUSED.
* scan-decls.c: Include scan.h.
* scan.h (recognized_function, recognized_extern): Add prototypes.
* stmt.c: Include output.h.
* toplev.c (error_for_asm, warning_for_asm): Remove prototypes.
(output_lang_identify): Hide prototype and definition.
(float_signal): Mark parameter `signo' with ATTRIBUTE_UNUSED.
(pipe_closed): Likewise.
* toplev.h (count_error, strip_off_ending, error_for_asm,
warning_for_asm): Add prototypes.
From-SVN: r19712
1998-05-13 14:40:39 +02:00
int signo ATTRIBUTE_UNUSED ;
1992-02-06 00:20:23 +01:00
{
fatal ( " output pipe has been closed " ) ;
}
/* Strip off a legitimate source ending from the input string NAME of
1995-06-28 21:48:17 +02:00
length LEN . Rather than having to know the names used by all of
1998-01-28 12:46:37 +01:00
our front ends , we strip off an ending of a period followed by
up to five characters . ( Java uses " .class " . ) */
1992-02-06 00:20:23 +01:00
void
strip_off_ending ( name , len )
char * name ;
int len ;
{
1998-01-28 12:46:37 +01:00
int i ;
for ( i = 2 ; i < 6 & & len > i ; i + + )
{
if ( name [ len - i ] = = ' . ' )
{
name [ len - i ] = ' \0 ' ;
break ;
}
}
1992-02-06 00:20:23 +01:00
}
1993-09-28 01:23:58 +01:00
/* Output a quoted string. */
1996-07-04 00:07:53 +02:00
1993-09-28 01:23:58 +01:00
void
output_quoted_string ( asm_file , string )
FILE * asm_file ;
cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
* cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
Instead of writing to const char *buf directly, use a non-const
variable `wbuf' to allocate and write a string, then set buf = wbuf.
* cppulp.c (user_label_prefix): Qualify a char* with the `const'
keyword.
* dyn-string.c (dyn_string_append): Likewise.
* dyn-string.h (dyn_string_append): Likewise.
* final.c (end_final, output_operand_lossage, asm_fprintf): Likewise.
* output.h (end_final, output_operand_lossage, asm_fprintf,
named_section, decode_reg_name, make_decl_rtl, user_label_prefix):
Likewise.
* profile.c (init_branch_prob): Likewise.
* toplev.c (set_target_switch, vmessage,
v_message_with_file_and_line, v_message_with_decl,
v_error_with_file_and_line, v_error_with_decl, v_error_for_asm,
verror, vfatal, v_warning_with_file_and_line, v_warning_with_decl,
v_warning_for_asm, vwarning, vpedwarn, v_pedwarn_with_decl,
v_pedwarn_with_file_and_line, vsorry, v_really_sorry,
open_dump_file, dump_rtl, clean_dump_file,
print_version, print_single_switch, print_switch_values,
dump_base_name, debug_args, lang_independent_options,
user_label_prefix, documented_lang_options, target_switches,
target_options, print_time, pfatal_with_name, fatal_io_error,
fatal_insn, default_print_error_function, print_error_function,
report_error_function, error_with_file_and_line, error_with_decl,
error_for_asm, error, fatal, warning_with_file_and_line,
warning_with_decl, warning_for_asm, warning, pedwarn,
pedwarn_with_decl, pedwarn_with_file_and_line, sorry,
really_sorry, botch, output_quoted_string, output_file_directive,
open_dump_file, rest_of_decl_compilation, display_help, main):
Likewise.
* toplev.h (print_time, fatal, fatal_io_error, pfatal_with_name,
fatal_insn, warning, error, pedwarn, pedwarn_with_file_and_line,
warning_with_file_and_line, error_with_file_and_line, sorry,
really_sorry, default_print_error_function, report_error_function,
rest_of_decl_compilation, pedwarn_with_decl, warning_with_decl,
error_with_decl, error_for_asm, warning_for_asm, output_quoted_string,
output_file_directive, botch): Likewise.
* tree.h (make_decl_rtl): Likewise.
* varasm.c (strip_reg_name, named_section, decode_reg_name,
make_decl_rtl): Likewise.
From-SVN: r24743
1999-01-18 09:53:41 +01:00
const char * string ;
1993-09-28 01:23:58 +01:00
{
1997-11-02 22:19:36 +01:00
# ifdef OUTPUT_QUOTED_STRING
OUTPUT_QUOTED_STRING ( asm_file , string ) ;
# else
1993-09-28 01:23:58 +01:00
char c ;
putc ( ' \" ' , asm_file ) ;
while ( ( c = * string + + ) ! = 0 )
{
if ( c = = ' \" ' | | c = = ' \\ ' )
putc ( ' \\ ' , asm_file ) ;
putc ( c , asm_file ) ;
}
putc ( ' \" ' , asm_file ) ;
1997-11-02 22:19:36 +01:00
# endif
1993-09-28 01:23:58 +01:00
}
1992-02-06 00:20:23 +01:00
/* Output a file name in the form wanted by System V. */
void
output_file_directive ( asm_file , input_name )
FILE * asm_file ;
cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
* cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
Instead of writing to const char *buf directly, use a non-const
variable `wbuf' to allocate and write a string, then set buf = wbuf.
* cppulp.c (user_label_prefix): Qualify a char* with the `const'
keyword.
* dyn-string.c (dyn_string_append): Likewise.
* dyn-string.h (dyn_string_append): Likewise.
* final.c (end_final, output_operand_lossage, asm_fprintf): Likewise.
* output.h (end_final, output_operand_lossage, asm_fprintf,
named_section, decode_reg_name, make_decl_rtl, user_label_prefix):
Likewise.
* profile.c (init_branch_prob): Likewise.
* toplev.c (set_target_switch, vmessage,
v_message_with_file_and_line, v_message_with_decl,
v_error_with_file_and_line, v_error_with_decl, v_error_for_asm,
verror, vfatal, v_warning_with_file_and_line, v_warning_with_decl,
v_warning_for_asm, vwarning, vpedwarn, v_pedwarn_with_decl,
v_pedwarn_with_file_and_line, vsorry, v_really_sorry,
open_dump_file, dump_rtl, clean_dump_file,
print_version, print_single_switch, print_switch_values,
dump_base_name, debug_args, lang_independent_options,
user_label_prefix, documented_lang_options, target_switches,
target_options, print_time, pfatal_with_name, fatal_io_error,
fatal_insn, default_print_error_function, print_error_function,
report_error_function, error_with_file_and_line, error_with_decl,
error_for_asm, error, fatal, warning_with_file_and_line,
warning_with_decl, warning_for_asm, warning, pedwarn,
pedwarn_with_decl, pedwarn_with_file_and_line, sorry,
really_sorry, botch, output_quoted_string, output_file_directive,
open_dump_file, rest_of_decl_compilation, display_help, main):
Likewise.
* toplev.h (print_time, fatal, fatal_io_error, pfatal_with_name,
fatal_insn, warning, error, pedwarn, pedwarn_with_file_and_line,
warning_with_file_and_line, error_with_file_and_line, sorry,
really_sorry, default_print_error_function, report_error_function,
rest_of_decl_compilation, pedwarn_with_decl, warning_with_decl,
error_with_decl, error_for_asm, warning_for_asm, output_quoted_string,
output_file_directive, botch): Likewise.
* tree.h (make_decl_rtl): Likewise.
* varasm.c (strip_reg_name, named_section, decode_reg_name,
make_decl_rtl): Likewise.
From-SVN: r24743
1999-01-18 09:53:41 +01:00
const char * input_name ;
1992-02-06 00:20:23 +01:00
{
int len = strlen ( input_name ) ;
cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
* cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
Instead of writing to const char *buf directly, use a non-const
variable `wbuf' to allocate and write a string, then set buf = wbuf.
* cppulp.c (user_label_prefix): Qualify a char* with the `const'
keyword.
* dyn-string.c (dyn_string_append): Likewise.
* dyn-string.h (dyn_string_append): Likewise.
* final.c (end_final, output_operand_lossage, asm_fprintf): Likewise.
* output.h (end_final, output_operand_lossage, asm_fprintf,
named_section, decode_reg_name, make_decl_rtl, user_label_prefix):
Likewise.
* profile.c (init_branch_prob): Likewise.
* toplev.c (set_target_switch, vmessage,
v_message_with_file_and_line, v_message_with_decl,
v_error_with_file_and_line, v_error_with_decl, v_error_for_asm,
verror, vfatal, v_warning_with_file_and_line, v_warning_with_decl,
v_warning_for_asm, vwarning, vpedwarn, v_pedwarn_with_decl,
v_pedwarn_with_file_and_line, vsorry, v_really_sorry,
open_dump_file, dump_rtl, clean_dump_file,
print_version, print_single_switch, print_switch_values,
dump_base_name, debug_args, lang_independent_options,
user_label_prefix, documented_lang_options, target_switches,
target_options, print_time, pfatal_with_name, fatal_io_error,
fatal_insn, default_print_error_function, print_error_function,
report_error_function, error_with_file_and_line, error_with_decl,
error_for_asm, error, fatal, warning_with_file_and_line,
warning_with_decl, warning_for_asm, warning, pedwarn,
pedwarn_with_decl, pedwarn_with_file_and_line, sorry,
really_sorry, botch, output_quoted_string, output_file_directive,
open_dump_file, rest_of_decl_compilation, display_help, main):
Likewise.
* toplev.h (print_time, fatal, fatal_io_error, pfatal_with_name,
fatal_insn, warning, error, pedwarn, pedwarn_with_file_and_line,
warning_with_file_and_line, error_with_file_and_line, sorry,
really_sorry, default_print_error_function, report_error_function,
rest_of_decl_compilation, pedwarn_with_decl, warning_with_decl,
error_with_decl, error_for_asm, warning_for_asm, output_quoted_string,
output_file_directive, botch): Likewise.
* tree.h (make_decl_rtl): Likewise.
* varasm.c (strip_reg_name, named_section, decode_reg_name,
make_decl_rtl): Likewise.
From-SVN: r24743
1999-01-18 09:53:41 +01:00
const char * na = input_name + len ;
1992-02-06 00:20:23 +01:00
/* NA gets INPUT_NAME sans directory names. */
while ( na > input_name )
{
1998-10-08 23:22:45 +02:00
if ( na [ - 1 ] = = ' / ' )
break ;
# ifdef DIR_SEPARATOR
1998-10-08 23:21:48 +02:00
if ( na [ - 1 ] = = DIR_SEPARATOR )
1992-02-06 00:20:23 +01:00
break ;
1998-10-08 23:22:45 +02:00
# endif
1992-02-06 00:20:23 +01:00
na - - ;
}
# ifdef ASM_OUTPUT_MAIN_SOURCE_FILENAME
ASM_OUTPUT_MAIN_SOURCE_FILENAME ( asm_file , na ) ;
# else
# ifdef ASM_OUTPUT_SOURCE_FILENAME
ASM_OUTPUT_SOURCE_FILENAME ( asm_file , na ) ;
# else
1993-09-28 01:23:58 +01:00
fprintf ( asm_file , " \t .file \t " ) ;
output_quoted_string ( asm_file , na ) ;
fputc ( ' \n ' , asm_file ) ;
1992-02-06 00:20:23 +01:00
# endif
# endif
}
1998-11-04 23:49:18 +01:00
# ifdef ASM_IDENTIFY_LANGUAGE
1996-07-04 00:07:53 +02:00
/* Routine to build language identifier for object file. */
1993-03-25 09:51:26 +01:00
static void
output_lang_identify ( asm_out_file )
FILE * asm_out_file ;
{
int len = strlen ( lang_identify ( ) ) + sizeof ( " __gnu_compiled_ " ) + 1 ;
char * s = ( char * ) alloca ( len ) ;
sprintf ( s , " __gnu_compiled_%s " , lang_identify ( ) ) ;
ASM_OUTPUT_LABEL ( asm_out_file , s ) ;
}
1998-11-04 23:49:18 +01:00
# endif
1993-03-25 09:51:26 +01:00
1994-02-08 16:13:41 +01:00
/* Routine to open a dump file. */
1998-01-26 23:48:32 +01:00
static void
open_dump_file ( suffix , function_name )
cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
* cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
Instead of writing to const char *buf directly, use a non-const
variable `wbuf' to allocate and write a string, then set buf = wbuf.
* cppulp.c (user_label_prefix): Qualify a char* with the `const'
keyword.
* dyn-string.c (dyn_string_append): Likewise.
* dyn-string.h (dyn_string_append): Likewise.
* final.c (end_final, output_operand_lossage, asm_fprintf): Likewise.
* output.h (end_final, output_operand_lossage, asm_fprintf,
named_section, decode_reg_name, make_decl_rtl, user_label_prefix):
Likewise.
* profile.c (init_branch_prob): Likewise.
* toplev.c (set_target_switch, vmessage,
v_message_with_file_and_line, v_message_with_decl,
v_error_with_file_and_line, v_error_with_decl, v_error_for_asm,
verror, vfatal, v_warning_with_file_and_line, v_warning_with_decl,
v_warning_for_asm, vwarning, vpedwarn, v_pedwarn_with_decl,
v_pedwarn_with_file_and_line, vsorry, v_really_sorry,
open_dump_file, dump_rtl, clean_dump_file,
print_version, print_single_switch, print_switch_values,
dump_base_name, debug_args, lang_independent_options,
user_label_prefix, documented_lang_options, target_switches,
target_options, print_time, pfatal_with_name, fatal_io_error,
fatal_insn, default_print_error_function, print_error_function,
report_error_function, error_with_file_and_line, error_with_decl,
error_for_asm, error, fatal, warning_with_file_and_line,
warning_with_decl, warning_for_asm, warning, pedwarn,
pedwarn_with_decl, pedwarn_with_file_and_line, sorry,
really_sorry, botch, output_quoted_string, output_file_directive,
open_dump_file, rest_of_decl_compilation, display_help, main):
Likewise.
* toplev.h (print_time, fatal, fatal_io_error, pfatal_with_name,
fatal_insn, warning, error, pedwarn, pedwarn_with_file_and_line,
warning_with_file_and_line, error_with_file_and_line, sorry,
really_sorry, default_print_error_function, report_error_function,
rest_of_decl_compilation, pedwarn_with_decl, warning_with_decl,
error_with_decl, error_for_asm, warning_for_asm, output_quoted_string,
output_file_directive, botch): Likewise.
* tree.h (make_decl_rtl): Likewise.
* varasm.c (strip_reg_name, named_section, decode_reg_name,
make_decl_rtl): Likewise.
From-SVN: r24743
1999-01-18 09:53:41 +01:00
const char * suffix ;
const char * function_name ;
1998-01-26 23:48:32 +01:00
{
char * dumpname ;
1996-07-04 00:07:53 +02:00
1998-01-26 23:48:32 +01:00
TIMEVAR
( dump_time ,
{
c-aux-info.c (concat): Don't define.
* c-aux-info.c (concat): Don't define.
* cccp.c (my_strerror): Likewise. All callers changed to use
xstrerror instead.
(do_include): Call xstrdup, not xmalloc/strcpy.
(grow_outbuf): Don't check if xrealloc returns NULL, it can't.
(xmalloc, xrealloc, xcalloc, xstrdup): Don't define.
* collect2.c (my_strsignal): Likewise. All callers changed to use
strsignal instead.
(locatelib): Call xstrdup, not xmalloc/strcpy.
* 1750a.h (ASM_OUTPUT_INTERNAL_LABEL): Call xmalloc, not malloc.
* dsp16xx.c (override_options): Call xstrdup, not xmalloc/strcpy.
* i370.h (ASM_DECLARE_FUNCTION_NAME): Call xmalloc, not malloc.
* mips.c (build_mips16_call_stub): Call xstrdup, not xmalloc/strcpy.
* cppinit.c (cpp_options_init): Call xcalloc, not xmalloc/bzero.
* dwarfout.c (dwarfout_init): Call concat, not xmalloc/strcpy/...
* except.c (new_eh_region_entry): Call xmalloc/xrealloc, not
malloc/realloc.
(find_all_handler_type_matches): Likewise. Don't check return
value.
(get_new_handler, init_insn_eh_region, process_nestinfo): Call
xmalloc, not malloc.
(init_eh_nesting_info): Likewise. Call xcalloc, not xmalloc/bzero.
* gcc.c (xstrerror, xmalloc, xrealloc): Don't define.
(init_spec): Call xcalloc, not xmalloc/bzero.
(set_spec): Call xstrdup, not save_string.
(record_temp_file): Call xstrdup, not xmalloc/strcpy.
(find_a_file): Call xstrdup, not xmalloc/strcpy.
(process_command): Call xstrdup, not save_string.
(main): Call xcalloc, not xmalloc/bzero.
* gcov.c (xmalloc): Don't define.
(create_program_flow_graph): Call xcalloc, not xmalloc/bzero.
(scan_for_source_files): Call xstrdup, not xmalloc/strcpy.
(output_data): Call xcalloc, not xmalloc/bzero.
* haifa-sched.c (schedule_insns): Call xcalloc, not xmalloc/bzero.
* mips-tdump.c (xmalloc): Don't define.
(print_symbol): Call xmalloc, not malloc.
(read_tfile): Call xcalloc, not calloc.
* mips-tfile.c (xfree, my_strsignal, xmalloc, xcalloc, xrealloc):
Don't define. All callers of xfree/my_strsignal changed to use
free/strsignal instead.
(allocate_cluster): Call xcalloc, not calloc.
* objc/objc-act.c (lang_init): Call concat, not xmalloc/strcpy/...
Fix memory leak, free allocated memory.
* prefix.c (translate_name): Call xstrdup, not save_string.
(update_path): Likewise.
* profile.c (branch_prob): Call xstrdup, not xmalloc/strcpy.
* protoize.c (xstrerror, xmalloc, xrealloc, xfree, savestring2):
Don't define. Callers of xfree/savestring2 changed to use
free/concat instead.
* reload1.c (reload): Call xcalloc, not xmalloc/bzero.
(init_elim_table): Likewise.
* resource.c (init_resource_info): Likewise.
* stupid.c (stupid_life_analysis): Likewise.
* toplev.c (xmalloc, xcalloc, xrealloc, xstrdup): Don't define.
(open_dump_file): Call concat, not xmalloc/strcpy/...
(clean_dump_file): Likewise.
(compile_file): Call xstrdup, not xmalloc/strcpy.
From-SVN: r29148
1999-09-07 04:36:41 +02:00
dumpname = concat ( dump_base_name , suffix , NULL ) ;
1998-01-26 23:48:32 +01:00
if ( rtl_dump_file ! = NULL )
fclose ( rtl_dump_file ) ;
rtl_dump_file = fopen ( dumpname , " a " ) ;
if ( rtl_dump_file = = NULL )
pfatal_with_name ( dumpname ) ;
free ( dumpname ) ;
if ( function_name )
fprintf ( rtl_dump_file , " \n ;; Function %s \n \n " , function_name ) ;
} ) ;
return ;
}
/* Routine to close a dump file. */
static void
close_dump_file ( func , insns )
2000-01-17 16:55:18 +01:00
void ( * func ) PARAMS ( ( FILE * , rtx ) ) ;
1998-01-26 23:48:32 +01:00
rtx insns ;
{
TIMEVAR
( dump_time ,
{
if ( func )
func ( rtl_dump_file , insns ) ;
fflush ( rtl_dump_file ) ;
fclose ( rtl_dump_file ) ;
rtl_dump_file = NULL ;
} ) ;
return ;
}
/* Routine to dump rtl into a file. */
static void
dump_rtl ( suffix , decl , func , insns )
cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
* cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
Instead of writing to const char *buf directly, use a non-const
variable `wbuf' to allocate and write a string, then set buf = wbuf.
* cppulp.c (user_label_prefix): Qualify a char* with the `const'
keyword.
* dyn-string.c (dyn_string_append): Likewise.
* dyn-string.h (dyn_string_append): Likewise.
* final.c (end_final, output_operand_lossage, asm_fprintf): Likewise.
* output.h (end_final, output_operand_lossage, asm_fprintf,
named_section, decode_reg_name, make_decl_rtl, user_label_prefix):
Likewise.
* profile.c (init_branch_prob): Likewise.
* toplev.c (set_target_switch, vmessage,
v_message_with_file_and_line, v_message_with_decl,
v_error_with_file_and_line, v_error_with_decl, v_error_for_asm,
verror, vfatal, v_warning_with_file_and_line, v_warning_with_decl,
v_warning_for_asm, vwarning, vpedwarn, v_pedwarn_with_decl,
v_pedwarn_with_file_and_line, vsorry, v_really_sorry,
open_dump_file, dump_rtl, clean_dump_file,
print_version, print_single_switch, print_switch_values,
dump_base_name, debug_args, lang_independent_options,
user_label_prefix, documented_lang_options, target_switches,
target_options, print_time, pfatal_with_name, fatal_io_error,
fatal_insn, default_print_error_function, print_error_function,
report_error_function, error_with_file_and_line, error_with_decl,
error_for_asm, error, fatal, warning_with_file_and_line,
warning_with_decl, warning_for_asm, warning, pedwarn,
pedwarn_with_decl, pedwarn_with_file_and_line, sorry,
really_sorry, botch, output_quoted_string, output_file_directive,
open_dump_file, rest_of_decl_compilation, display_help, main):
Likewise.
* toplev.h (print_time, fatal, fatal_io_error, pfatal_with_name,
fatal_insn, warning, error, pedwarn, pedwarn_with_file_and_line,
warning_with_file_and_line, error_with_file_and_line, sorry,
really_sorry, default_print_error_function, report_error_function,
rest_of_decl_compilation, pedwarn_with_decl, warning_with_decl,
error_with_decl, error_for_asm, warning_for_asm, output_quoted_string,
output_file_directive, botch): Likewise.
* tree.h (make_decl_rtl): Likewise.
* varasm.c (strip_reg_name, named_section, decode_reg_name,
make_decl_rtl): Likewise.
From-SVN: r24743
1999-01-18 09:53:41 +01:00
const char * suffix ;
1998-01-26 23:48:32 +01:00
tree decl ;
2000-01-17 16:55:18 +01:00
void ( * func ) PARAMS ( ( FILE * , rtx ) ) ;
1998-01-26 23:48:32 +01:00
rtx insns ;
1994-02-08 16:13:41 +01:00
{
1998-01-26 23:48:32 +01:00
open_dump_file ( suffix , decl_printable_name ( decl , 2 ) ) ;
close_dump_file ( func , insns ) ;
}
/* Routine to empty a dump file. */
static void
clean_dump_file ( suffix )
cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
* cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
Instead of writing to const char *buf directly, use a non-const
variable `wbuf' to allocate and write a string, then set buf = wbuf.
* cppulp.c (user_label_prefix): Qualify a char* with the `const'
keyword.
* dyn-string.c (dyn_string_append): Likewise.
* dyn-string.h (dyn_string_append): Likewise.
* final.c (end_final, output_operand_lossage, asm_fprintf): Likewise.
* output.h (end_final, output_operand_lossage, asm_fprintf,
named_section, decode_reg_name, make_decl_rtl, user_label_prefix):
Likewise.
* profile.c (init_branch_prob): Likewise.
* toplev.c (set_target_switch, vmessage,
v_message_with_file_and_line, v_message_with_decl,
v_error_with_file_and_line, v_error_with_decl, v_error_for_asm,
verror, vfatal, v_warning_with_file_and_line, v_warning_with_decl,
v_warning_for_asm, vwarning, vpedwarn, v_pedwarn_with_decl,
v_pedwarn_with_file_and_line, vsorry, v_really_sorry,
open_dump_file, dump_rtl, clean_dump_file,
print_version, print_single_switch, print_switch_values,
dump_base_name, debug_args, lang_independent_options,
user_label_prefix, documented_lang_options, target_switches,
target_options, print_time, pfatal_with_name, fatal_io_error,
fatal_insn, default_print_error_function, print_error_function,
report_error_function, error_with_file_and_line, error_with_decl,
error_for_asm, error, fatal, warning_with_file_and_line,
warning_with_decl, warning_for_asm, warning, pedwarn,
pedwarn_with_decl, pedwarn_with_file_and_line, sorry,
really_sorry, botch, output_quoted_string, output_file_directive,
open_dump_file, rest_of_decl_compilation, display_help, main):
Likewise.
* toplev.h (print_time, fatal, fatal_io_error, pfatal_with_name,
fatal_insn, warning, error, pedwarn, pedwarn_with_file_and_line,
warning_with_file_and_line, error_with_file_and_line, sorry,
really_sorry, default_print_error_function, report_error_function,
rest_of_decl_compilation, pedwarn_with_decl, warning_with_decl,
error_with_decl, error_for_asm, warning_for_asm, output_quoted_string,
output_file_directive, botch): Likewise.
* tree.h (make_decl_rtl): Likewise.
* varasm.c (strip_reg_name, named_section, decode_reg_name,
make_decl_rtl): Likewise.
From-SVN: r24743
1999-01-18 09:53:41 +01:00
const char * suffix ;
1998-01-26 23:48:32 +01:00
{
c-aux-info.c (concat): Don't define.
* c-aux-info.c (concat): Don't define.
* cccp.c (my_strerror): Likewise. All callers changed to use
xstrerror instead.
(do_include): Call xstrdup, not xmalloc/strcpy.
(grow_outbuf): Don't check if xrealloc returns NULL, it can't.
(xmalloc, xrealloc, xcalloc, xstrdup): Don't define.
* collect2.c (my_strsignal): Likewise. All callers changed to use
strsignal instead.
(locatelib): Call xstrdup, not xmalloc/strcpy.
* 1750a.h (ASM_OUTPUT_INTERNAL_LABEL): Call xmalloc, not malloc.
* dsp16xx.c (override_options): Call xstrdup, not xmalloc/strcpy.
* i370.h (ASM_DECLARE_FUNCTION_NAME): Call xmalloc, not malloc.
* mips.c (build_mips16_call_stub): Call xstrdup, not xmalloc/strcpy.
* cppinit.c (cpp_options_init): Call xcalloc, not xmalloc/bzero.
* dwarfout.c (dwarfout_init): Call concat, not xmalloc/strcpy/...
* except.c (new_eh_region_entry): Call xmalloc/xrealloc, not
malloc/realloc.
(find_all_handler_type_matches): Likewise. Don't check return
value.
(get_new_handler, init_insn_eh_region, process_nestinfo): Call
xmalloc, not malloc.
(init_eh_nesting_info): Likewise. Call xcalloc, not xmalloc/bzero.
* gcc.c (xstrerror, xmalloc, xrealloc): Don't define.
(init_spec): Call xcalloc, not xmalloc/bzero.
(set_spec): Call xstrdup, not save_string.
(record_temp_file): Call xstrdup, not xmalloc/strcpy.
(find_a_file): Call xstrdup, not xmalloc/strcpy.
(process_command): Call xstrdup, not save_string.
(main): Call xcalloc, not xmalloc/bzero.
* gcov.c (xmalloc): Don't define.
(create_program_flow_graph): Call xcalloc, not xmalloc/bzero.
(scan_for_source_files): Call xstrdup, not xmalloc/strcpy.
(output_data): Call xcalloc, not xmalloc/bzero.
* haifa-sched.c (schedule_insns): Call xcalloc, not xmalloc/bzero.
* mips-tdump.c (xmalloc): Don't define.
(print_symbol): Call xmalloc, not malloc.
(read_tfile): Call xcalloc, not calloc.
* mips-tfile.c (xfree, my_strsignal, xmalloc, xcalloc, xrealloc):
Don't define. All callers of xfree/my_strsignal changed to use
free/strsignal instead.
(allocate_cluster): Call xcalloc, not calloc.
* objc/objc-act.c (lang_init): Call concat, not xmalloc/strcpy/...
Fix memory leak, free allocated memory.
* prefix.c (translate_name): Call xstrdup, not save_string.
(update_path): Likewise.
* profile.c (branch_prob): Call xstrdup, not xmalloc/strcpy.
* protoize.c (xstrerror, xmalloc, xrealloc, xfree, savestring2):
Don't define. Callers of xfree/savestring2 changed to use
free/concat instead.
* reload1.c (reload): Call xcalloc, not xmalloc/bzero.
(init_elim_table): Likewise.
* resource.c (init_resource_info): Likewise.
* stupid.c (stupid_life_analysis): Likewise.
* toplev.c (xmalloc, xcalloc, xrealloc, xstrdup): Don't define.
(open_dump_file): Call concat, not xmalloc/strcpy/...
(clean_dump_file): Likewise.
(compile_file): Call xstrdup, not xmalloc/strcpy.
From-SVN: r29148
1999-09-07 04:36:41 +02:00
char * const dumpname = concat ( dump_base_name , suffix , NULL ) ;
1994-02-08 16:13:41 +01:00
1998-01-26 23:48:32 +01:00
rtl_dump_file = fopen ( dumpname , " w " ) ;
if ( rtl_dump_file = = NULL )
pfatal_with_name ( dumpname ) ;
free ( dumpname ) ;
fclose ( rtl_dump_file ) ;
rtl_dump_file = NULL ;
return ;
1994-02-08 16:13:41 +01:00
}
1999-04-23 01:06:09 +02:00
/* Do any final processing required for the declarations in VEC, of
which there are LEN . We write out inline functions and variables
that have been deferred until this point , but which are required .
Returns non - zero if anything was put out . */
int
wrapup_global_declarations ( vec , len )
tree * vec ;
int len ;
{
tree decl ;
int i ;
int reconsider ;
int output_something = 0 ;
for ( i = 0 ; i < len ; i + + )
{
decl = vec [ i ] ;
/* We're not deferring this any longer. */
DECL_DEFER_OUTPUT ( decl ) = 0 ;
if ( TREE_CODE ( decl ) = = VAR_DECL & & DECL_SIZE ( decl ) = = 0
& & incomplete_decl_finalize_hook ! = 0 )
( * incomplete_decl_finalize_hook ) ( decl ) ;
}
/* Now emit any global variables or functions that we have been
putting off . We need to loop in case one of the things emitted
here references another one which comes earlier in the list . */
do
{
reconsider = 0 ;
for ( i = 0 ; i < len ; i + + )
{
decl = vec [ i ] ;
if ( TREE_ASM_WRITTEN ( decl ) | | DECL_EXTERNAL ( decl ) )
continue ;
/* Don't write out static consts, unless we still need them.
We also keep static consts if not optimizing ( for debugging ) ,
unless the user specified - fno - keep - static - consts .
? ? ? They might be better written into the debug information .
This is possible when using DWARF .
A language processor that wants static constants to be always
written out ( even if it is not used ) is responsible for
calling rest_of_decl_compilation itself . E . g . the C front - end
calls rest_of_decl_compilation from finish_decl .
One motivation for this is that is conventional in some
environments to write things like :
static const char rcsid [ ] = " ... version string ... " ;
intending to force the string to be in the executable .
A language processor that would prefer to have unneeded
static constants " optimized away " would just defer writing
them out until here . E . g . C + + does this , because static
constants are often defined in header files .
? ? ? A tempting alternative ( for both C and C + + ) would be
to force a constant to be written if and only if it is
defined in a main file , as opposed to an include file . */
if ( TREE_CODE ( decl ) = = VAR_DECL & & TREE_STATIC ( decl )
& & ( ! TREE_READONLY ( decl )
| | TREE_PUBLIC ( decl )
| | ( ! optimize & & flag_keep_static_consts )
| | TREE_SYMBOL_REFERENCED ( DECL_ASSEMBLER_NAME ( decl ) ) ) )
{
reconsider = 1 ;
rest_of_decl_compilation ( decl , NULL_PTR , 1 , 1 ) ;
}
if ( TREE_CODE ( decl ) = = FUNCTION_DECL
& & DECL_INITIAL ( decl ) ! = 0
& & DECL_SAVED_INSNS ( decl ) ! = 0
& & ( flag_keep_inline_functions
1999-05-02 19:43:33 +02:00
| | ( TREE_PUBLIC ( decl ) & & ! DECL_COMDAT ( decl ) )
1999-04-23 01:06:09 +02:00
| | TREE_SYMBOL_REFERENCED ( DECL_ASSEMBLER_NAME ( decl ) ) ) )
{
reconsider = 1 ;
temporary_allocation ( ) ;
output_inline_function ( decl ) ;
permanent_allocation ( 1 ) ;
}
}
if ( reconsider )
output_something = 1 ;
}
while ( reconsider ) ;
return output_something ;
}
/* Issue appropriate warnings for the global declarations in VEC (of
which there are LEN ) . Output debugging information for them . */
void
check_global_declarations ( vec , len )
tree * vec ;
int len ;
{
tree decl ;
int i ;
for ( i = 0 ; i < len ; i + + )
{
decl = vec [ i ] ;
if ( TREE_CODE ( decl ) = = VAR_DECL & & TREE_STATIC ( decl )
& & ! TREE_ASM_WRITTEN ( decl ) )
/* Cancel the RTL for this decl so that, if debugging info
output for global variables is still to come ,
this one will be omitted . */
DECL_RTL ( decl ) = NULL ;
/* Warn about any function
declared static but not defined .
We don ' t warn about variables ,
because many programs have static variables
that exist only to get some text into the object file . */
if ( TREE_CODE ( decl ) = = FUNCTION_DECL
& & ( warn_unused
| | TREE_SYMBOL_REFERENCED ( DECL_ASSEMBLER_NAME ( decl ) ) )
& & DECL_INITIAL ( decl ) = = 0
& & DECL_EXTERNAL ( decl )
& & ! DECL_ARTIFICIAL ( decl )
& & ! TREE_PUBLIC ( decl ) )
{
if ( TREE_SYMBOL_REFERENCED ( DECL_ASSEMBLER_NAME ( decl ) ) )
pedwarn_with_decl ( decl ,
" `%s' used but never defined " ) ;
else
warning_with_decl ( decl ,
" `%s' declared `static' but never defined " ) ;
/* This symbol is effectively an "extern" declaration now. */
TREE_PUBLIC ( decl ) = 1 ;
assemble_external ( decl ) ;
}
/* Warn about static fns or vars defined but not used,
but not about inline functions or static consts
since defining those in header files is normal practice . */
if ( warn_unused
& & ( ( TREE_CODE ( decl ) = = FUNCTION_DECL & & ! DECL_INLINE ( decl ) )
| | ( TREE_CODE ( decl ) = = VAR_DECL & & ! TREE_READONLY ( decl ) ) )
& & ! DECL_IN_SYSTEM_HEADER ( decl )
& & ! DECL_EXTERNAL ( decl )
& & ! TREE_PUBLIC ( decl )
& & ! TREE_USED ( decl )
& & ( TREE_CODE ( decl ) = = FUNCTION_DECL | | ! DECL_REGISTER ( decl ) )
/* The TREE_USED bit for file-scope decls
is kept in the identifier , to handle multiple
external decls in different scopes . */
& & ! TREE_USED ( DECL_NAME ( decl ) ) )
warning_with_decl ( decl , " `%s' defined but not used " ) ;
# ifdef SDB_DEBUGGING_INFO
/* The COFF linker can move initialized global vars to the end.
And that can screw up the symbol ordering .
By putting the symbols in that order to begin with ,
we avoid a problem . mcsun ! unido ! fauern ! tumuc ! pes @ uunet . uu . net . */
if ( write_symbols = = SDB_DEBUG & & TREE_CODE ( decl ) = = VAR_DECL
& & TREE_PUBLIC ( decl ) & & DECL_INITIAL ( decl )
& & ! DECL_EXTERNAL ( decl )
& & DECL_RTL ( decl ) ! = 0 )
TIMEVAR ( symout_time , sdbout_symbol ( decl , 0 ) ) ;
/* Output COFF information for non-global
file - scope initialized variables . */
if ( write_symbols = = SDB_DEBUG
& & TREE_CODE ( decl ) = = VAR_DECL
& & DECL_INITIAL ( decl )
& & ! DECL_EXTERNAL ( decl )
& & DECL_RTL ( decl ) ! = 0
& & GET_CODE ( DECL_RTL ( decl ) ) = = MEM )
TIMEVAR ( symout_time , sdbout_toplevel_data ( decl ) ) ;
# endif /* SDB_DEBUGGING_INFO */
# ifdef DWARF_DEBUGGING_INFO
/* Output DWARF information for file-scope tentative data object
declarations , file - scope ( extern ) function declarations ( which
had no corresponding body ) and file - scope tagged type declarations
and definitions which have not yet been forced out . */
if ( write_symbols = = DWARF_DEBUG
& & ( TREE_CODE ( decl ) ! = FUNCTION_DECL | | ! DECL_INITIAL ( decl ) ) )
TIMEVAR ( symout_time , dwarfout_file_scope_decl ( decl , 1 ) ) ;
# endif
# ifdef DWARF2_DEBUGGING_INFO
/* Output DWARF2 information for file-scope tentative data object
declarations , file - scope ( extern ) function declarations ( which
had no corresponding body ) and file - scope tagged type declarations
and definitions which have not yet been forced out . */
if ( write_symbols = = DWARF2_DEBUG
& & ( TREE_CODE ( decl ) ! = FUNCTION_DECL | | ! DECL_INITIAL ( decl ) ) )
TIMEVAR ( symout_time , dwarf2out_decl ( decl ) ) ;
# endif
}
}
1998-01-26 23:48:32 +01:00
1992-02-06 00:20:23 +01:00
/* Compile an entire file of output from cpp, named NAME.
Write a file of assembly output and various debugging dumps . */
static void
compile_file ( name )
char * name ;
{
tree globals ;
int start_time ;
int name_specified = name ! = 0 ;
if ( dump_base_name = = 0 )
dump_base_name = name ? name : " gccdump " ;
parse_time = 0 ;
varconst_time = 0 ;
integration_time = 0 ;
jump_time = 0 ;
cse_time = 0 ;
1998-05-20 02:24:32 +02:00
gcse_time = 0 ;
1992-02-06 00:20:23 +01:00
loop_time = 0 ;
cse2_time = 0 ;
1997-03-28 23:40:07 +01:00
branch_prob_time = 0 ;
1992-02-06 00:20:23 +01:00
flow_time = 0 ;
combine_time = 0 ;
1997-08-12 06:07:19 +02:00
regmove_time = 0 ;
1992-02-06 00:20:23 +01:00
sched_time = 0 ;
local_alloc_time = 0 ;
global_alloc_time = 0 ;
1999-02-26 00:45:42 +01:00
flow2_time = 0 ;
1999-10-05 06:04:48 +02:00
peephole2_time = 0 ;
1992-02-06 00:20:23 +01:00
sched2_time = 0 ;
dbr_sched_time = 0 ;
shorten_branch_time = 0 ;
stack_reg_time = 0 ;
final_time = 0 ;
symout_time = 0 ;
dump_time = 0 ;
/* Initialize data in various passes. */
init_obstacks ( ) ;
init_tree_codes ( ) ;
1998-04-15 14:31:38 +02:00
name = init_parse ( name ) ;
1992-02-06 00:20:23 +01:00
init_emit_once ( debug_info_level = = DINFO_LEVEL_NORMAL
1997-03-28 23:40:07 +01:00
| | debug_info_level = = DINFO_LEVEL_VERBOSE
1999-08-18 12:43:26 +02:00
| | flag_test_coverage
| | warn_notreached ) ;
1994-05-28 01:29:18 +02:00
init_regs ( ) ;
1992-02-06 00:20:23 +01:00
init_decl_processing ( ) ;
init_optabs ( ) ;
init_stmt ( ) ;
1999-09-16 03:12:25 +02:00
init_eh ( ) ;
1992-02-06 00:20:23 +01:00
init_loop ( ) ;
init_reload ( ) ;
1997-12-24 22:39:44 +01:00
init_alias_once ( ) ;
Makefile.in (tree.o): Depend on ggc.h.
* Makefile.in (tree.o): Depend on ggc.h.
(varasm.o): Likewise.
(function.o): Likewise.
(stmt.o): Likewise.
(except.o): Likewise.
(optabs.o): Likewise.
(emit-rtl.o): Likewise.
* emit-rtl.c: Include ggc.h.
(sequence_element_free_list): Remove, and all references.
(mark_sequence): New functions.
(mark_emit_state): New function.
* except.c: Include ggc.h.
(mark_eh_node, mark_eh_stack, mark_eh_queue): New functions.
(mark_tree_label_node): New functions.
(mark_eh_state): New function.
* function.c: Include ggc.h.
(mark_temp_slot, mark_function_chain): New functions.
(mark_function_state): New function.
(init_function_once): New function.
* function.h (init_function_once): New function.
* ggc-callbacks.c (lang_mark_false_label_stack): New function.
* ggc.h (label_node): Declare.
(eh_status, emit_status, stmt_status, varasm_status): Likewise.
(lang_mark_false_label_stack): New function.
(mark_temp_slot): Remove declaration.
(mark_function_chain): Likewise.
(mark_eh_state): Adjust prototype.
(mark_stmt_state, mark_emit_state, mark_varasm_state, mark_optab):
Likewise.
* optabs.c: Include ggc.h.
(mark_optab): New function.
(init_optabs): Add gc roots.
* stmt.c: Include ggc.h.
(mark_cond_nesting, mark_loop_nesting): New functions.
(mark_block_nesting, mark_case_nesting, mark_goto_fixup): Likewise.
(mark_stmt_state): New function.
* toplev.c (compile_file): Call init_function_once.
* tree.c: Include ggc.h.
(type_hash): Move declaration earlier in file.
(TYPE_HASH_SIZE, type_hash_table): Likewise.
(init_obstacks): Add gc roots.
(mark_type_hash): New function.
* varasm.c: Include ggc.h.
(mark_pool_constant): New function.
(mark_varasm_state): New function.
Co-Authored-By: Bernd Schmidt <bernds@cygnus.co.uk>
Co-Authored-By: Mark Mitchell <mark@codesourcery.com>
From-SVN: r29119
1999-09-05 04:41:35 +02:00
init_function_once ( ) ;
1999-09-05 05:49:52 +02:00
init_stor_layout_once ( ) ;
1999-09-09 09:07:41 +02:00
init_varasm_once ( ) ;
1992-02-06 00:20:23 +01:00
1999-08-09 16:00:21 +02:00
/* The following initialization functions need to generate rtl, so
provide a dummy function context for them . */
init_dummy_function_start ( ) ;
init_expmed ( ) ;
init_expr_once ( ) ;
1992-02-06 00:20:23 +01:00
if ( flag_caller_saves )
init_caller_save ( ) ;
1999-08-09 16:00:21 +02:00
expand_dummy_function_end ( ) ;
1992-02-06 00:20:23 +01:00
1992-03-23 20:29:32 +01:00
/* If auxiliary info generation is desired, open the output file.
This goes in the same directory as the source file - - unlike
all the other output files . */
1992-02-06 00:20:23 +01:00
if ( flag_gen_aux_info )
{
aux_info_file = fopen ( aux_info_file_name , " w " ) ;
if ( aux_info_file = = 0 )
pfatal_with_name ( aux_info_file_name ) ;
}
1998-11-23 17:41:12 +01:00
/* Clear the dump files. */
1992-02-06 00:20:23 +01:00
if ( rtl_dump )
1999-10-05 06:04:48 +02:00
clean_dump_file ( " .00.rtl " ) ;
1992-02-06 00:20:23 +01:00
if ( jump_opt_dump )
1998-11-23 17:41:12 +01:00
{
1999-10-05 06:04:48 +02:00
clean_dump_file ( " .01.jump " ) ;
if ( graph_dump_format ! = no_graph )
clean_graph_dump_file ( dump_base_name , " .01.jump " ) ;
}
if ( cse_dump )
{
clean_dump_file ( " .02.cse " ) ;
1998-11-23 17:41:12 +01:00
if ( graph_dump_format ! = no_graph )
1999-10-05 06:04:48 +02:00
clean_graph_dump_file ( dump_base_name , " .02.cse " ) ;
1998-11-23 17:41:12 +01:00
}
1997-11-02 22:19:36 +01:00
if ( addressof_dump )
1998-11-23 17:41:12 +01:00
{
1999-10-05 06:04:48 +02:00
clean_dump_file ( " .03.addressof " ) ;
1998-11-23 17:41:12 +01:00
if ( graph_dump_format ! = no_graph )
1999-10-05 06:04:48 +02:00
clean_graph_dump_file ( dump_base_name , " .03.addressof " ) ;
1998-11-23 17:41:12 +01:00
}
1999-10-05 06:04:48 +02:00
if ( gcse_dump )
1998-11-23 17:41:12 +01:00
{
1999-10-05 06:04:48 +02:00
clean_dump_file ( " .04.gcse " ) ;
1998-11-23 17:41:12 +01:00
if ( graph_dump_format ! = no_graph )
1999-10-05 06:04:48 +02:00
clean_graph_dump_file ( dump_base_name , " .04.gcse " ) ;
1998-11-23 17:41:12 +01:00
}
1992-02-06 00:20:23 +01:00
if ( loop_dump )
1998-11-23 17:41:12 +01:00
{
1999-10-05 06:04:48 +02:00
clean_dump_file ( " .05.loop " ) ;
1998-11-23 17:41:12 +01:00
if ( graph_dump_format ! = no_graph )
1999-10-05 06:04:48 +02:00
clean_graph_dump_file ( dump_base_name , " .05.loop " ) ;
1998-11-23 17:41:12 +01:00
}
1992-02-06 00:20:23 +01:00
if ( cse2_dump )
1998-11-23 17:41:12 +01:00
{
1999-10-05 06:04:48 +02:00
clean_dump_file ( " .06.cse2 " ) ;
1998-11-23 17:41:12 +01:00
if ( graph_dump_format ! = no_graph )
1999-10-05 06:04:48 +02:00
clean_graph_dump_file ( dump_base_name , " .06.cse2 " ) ;
1998-11-23 17:41:12 +01:00
}
1997-03-28 23:40:07 +01:00
if ( branch_prob_dump )
1998-11-23 17:41:12 +01:00
{
1999-10-05 06:04:48 +02:00
clean_dump_file ( " .07.bp " ) ;
1998-11-23 17:41:12 +01:00
if ( graph_dump_format ! = no_graph )
1999-10-05 06:04:48 +02:00
clean_graph_dump_file ( dump_base_name , " .07.bp " ) ;
1998-11-23 17:41:12 +01:00
}
1992-02-06 00:20:23 +01:00
if ( flow_dump )
1998-11-23 17:41:12 +01:00
{
1999-10-05 06:04:48 +02:00
clean_dump_file ( " .08.flow " ) ;
1998-11-23 17:41:12 +01:00
if ( graph_dump_format ! = no_graph )
1999-10-05 06:04:48 +02:00
clean_graph_dump_file ( dump_base_name , " .08.flow " ) ;
1998-11-23 17:41:12 +01:00
}
1992-02-06 00:20:23 +01:00
if ( combine_dump )
1998-11-23 17:41:12 +01:00
{
1999-10-05 06:04:48 +02:00
clean_dump_file ( " .09.combine " ) ;
1998-11-23 17:41:12 +01:00
if ( graph_dump_format ! = no_graph )
1999-10-05 06:04:48 +02:00
clean_graph_dump_file ( dump_base_name , " .09.combine " ) ;
1998-11-23 17:41:12 +01:00
}
1997-08-12 06:07:19 +02:00
if ( regmove_dump )
1998-11-23 17:41:12 +01:00
{
1999-10-05 06:04:48 +02:00
clean_dump_file ( " .10.regmove " ) ;
1998-11-23 17:41:12 +01:00
if ( graph_dump_format ! = no_graph )
1999-10-05 06:04:48 +02:00
clean_graph_dump_file ( dump_base_name , " .10.regmove " ) ;
1998-11-23 17:41:12 +01:00
}
1999-10-05 06:04:48 +02:00
# ifdef INSN_SCHEDULING
1992-02-06 00:20:23 +01:00
if ( sched_dump )
1998-11-23 17:41:12 +01:00
{
1999-10-05 06:04:48 +02:00
clean_dump_file ( " .11.sched " ) ;
1998-11-23 17:41:12 +01:00
if ( graph_dump_format ! = no_graph )
1999-10-05 06:04:48 +02:00
clean_graph_dump_file ( dump_base_name , " .11.sched " ) ;
1998-11-23 17:41:12 +01:00
}
1999-10-05 06:04:48 +02:00
# endif
1992-02-06 00:20:23 +01:00
if ( local_reg_dump )
1998-11-23 17:41:12 +01:00
{
1999-10-05 06:04:48 +02:00
clean_dump_file ( " .12.lreg " ) ;
1998-11-23 17:41:12 +01:00
if ( graph_dump_format ! = no_graph )
1999-10-05 06:04:48 +02:00
clean_graph_dump_file ( dump_base_name , " .12.lreg " ) ;
1998-11-23 17:41:12 +01:00
}
1992-02-06 00:20:23 +01:00
if ( global_reg_dump )
1998-11-23 17:41:12 +01:00
{
1999-10-05 06:04:48 +02:00
clean_dump_file ( " .13.greg " ) ;
1998-11-23 17:41:12 +01:00
if ( graph_dump_format ! = no_graph )
1999-10-05 06:04:48 +02:00
clean_graph_dump_file ( dump_base_name , " .13.greg " ) ;
1998-11-23 17:41:12 +01:00
}
1999-02-26 00:45:42 +01:00
if ( flow2_dump )
{
1999-10-05 06:04:48 +02:00
clean_dump_file ( " .14.flow2 " ) ;
1999-02-26 00:45:42 +01:00
if ( graph_dump_format ! = no_graph )
1999-10-05 06:04:48 +02:00
clean_graph_dump_file ( dump_base_name , " .14.flow2 " ) ;
1999-02-26 00:45:42 +01:00
}
1999-10-05 06:04:48 +02:00
# ifdef HAVE_peephole2
1999-08-31 22:37:09 +02:00
if ( peephole2_dump )
{
1999-10-05 06:04:48 +02:00
clean_dump_file ( " .15.peephole2 " ) ;
1999-08-31 22:37:09 +02:00
if ( graph_dump_format ! = no_graph )
1999-10-05 06:04:48 +02:00
clean_graph_dump_file ( dump_base_name , " .15.peephole2 " ) ;
1999-08-31 22:37:09 +02:00
}
1999-10-05 06:04:48 +02:00
# endif
# ifdef INSN_SCHEDULING
1992-02-06 00:20:23 +01:00
if ( sched2_dump )
1998-11-23 17:41:12 +01:00
{
1999-10-05 06:04:48 +02:00
clean_dump_file ( " .16.sched2 " ) ;
1998-11-23 17:41:12 +01:00
if ( graph_dump_format ! = no_graph )
1999-10-05 06:04:48 +02:00
clean_graph_dump_file ( dump_base_name , " .16.sched2 " ) ;
1998-11-23 17:41:12 +01:00
}
1999-10-05 06:04:48 +02:00
# endif
1992-02-06 00:20:23 +01:00
if ( jump2_opt_dump )
1998-11-23 17:41:12 +01:00
{
1999-10-05 06:04:48 +02:00
clean_dump_file ( " .17.jump2 " ) ;
1998-11-23 17:41:12 +01:00
if ( graph_dump_format ! = no_graph )
1999-10-05 06:04:48 +02:00
clean_graph_dump_file ( dump_base_name , " .17.jump2 " ) ;
1998-11-23 17:41:12 +01:00
}
1999-10-05 06:04:48 +02:00
# ifdef MACHINE_DEPENDENT_REORG
if ( mach_dep_reorg_dump )
1998-11-23 17:41:12 +01:00
{
1999-10-05 06:04:48 +02:00
clean_dump_file ( " .18.mach " ) ;
1998-11-23 17:41:12 +01:00
if ( graph_dump_format ! = no_graph )
1999-10-05 06:04:48 +02:00
clean_graph_dump_file ( dump_base_name , " .18.mach " ) ;
1998-11-23 17:41:12 +01:00
}
1998-03-03 11:06:54 +01:00
# endif
1999-10-05 06:04:48 +02:00
# ifdef DELAY_SLOTS
if ( dbr_sched_dump )
1998-11-23 17:41:12 +01:00
{
1999-10-05 06:04:48 +02:00
clean_dump_file ( " .19.dbr " ) ;
1998-11-23 17:41:12 +01:00
if ( graph_dump_format ! = no_graph )
1999-10-05 06:04:48 +02:00
clean_graph_dump_file ( dump_base_name , " .19.dbr " ) ;
1998-11-23 17:41:12 +01:00
}
1999-10-05 06:04:48 +02:00
# endif
1992-02-06 00:20:23 +01:00
# ifdef STACK_REGS
if ( stack_reg_dump )
1998-11-23 17:41:12 +01:00
{
1999-10-05 06:04:48 +02:00
clean_dump_file ( " .20.stack " ) ;
1998-11-23 17:41:12 +01:00
if ( graph_dump_format ! = no_graph )
1999-10-05 06:04:48 +02:00
clean_graph_dump_file ( dump_base_name , " .20.stack " ) ;
1998-11-23 17:41:12 +01:00
}
1992-02-06 00:20:23 +01:00
# endif
/* Open assembler code output file. */
1998-10-14 18:15:09 +02:00
if ( flag_syntax_only )
asm_out_file = NULL ;
1992-02-06 00:20:23 +01:00
else
{
1998-10-14 18:15:09 +02:00
if ( ! name_specified & & asm_file_name = = 0 )
1992-02-06 00:20:23 +01:00
asm_out_file = stdout ;
else
1998-10-14 18:15:09 +02:00
{
if ( asm_file_name = = 0 )
1999-11-05 01:49:03 +01:00
{
int len = strlen ( dump_base_name ) ;
char * dumpname = ( char * ) xmalloc ( len + 6 ) ;
memcpy ( dumpname , dump_base_name , len + 1 ) ;
strip_off_ending ( dumpname , len ) ;
strcat ( dumpname , " .s " ) ;
asm_file_name = dumpname ;
}
1998-10-14 18:15:09 +02:00
if ( ! strcmp ( asm_file_name , " - " ) )
asm_out_file = stdout ;
else
asm_out_file = fopen ( asm_file_name , " w " ) ;
if ( asm_out_file = = 0 )
pfatal_with_name ( asm_file_name ) ;
}
1992-02-06 00:20:23 +01:00
1992-03-23 20:29:32 +01:00
# ifdef IO_BUFFER_SIZE
1998-10-14 18:15:09 +02:00
setvbuf ( asm_out_file , ( char * ) xmalloc ( IO_BUFFER_SIZE ) ,
_IOFBF , IO_BUFFER_SIZE ) ;
1992-03-23 20:29:32 +01:00
# endif
1998-10-14 18:15:09 +02:00
}
1992-03-23 20:29:32 +01:00
1999-09-07 12:10:01 +02:00
if ( ggc_p )
name = ggc_alloc_string ( name , strlen ( name ) ) ;
1992-02-06 00:20:23 +01:00
input_filename = name ;
1995-02-21 11:36:34 +01:00
/* Put an entry on the input file stack for the main input file. */
input_file_stack
= ( struct file_stack * ) xmalloc ( sizeof ( struct file_stack ) ) ;
input_file_stack - > next = 0 ;
input_file_stack - > name = input_filename ;
1992-02-06 00:20:23 +01:00
/* Perform language-specific initialization.
This may set main_input_filename . */
lang_init ( ) ;
/* If the input doesn't start with a #line, use the input name
as the official input file name . */
if ( main_input_filename = = 0 )
main_input_filename = name ;
1998-10-14 18:15:09 +02:00
if ( flag_syntax_only )
{
write_symbols = NO_DEBUG ;
profile_flag = 0 ;
profile_block_flag = 0 ;
}
else
{
ASM_FILE_START ( asm_out_file ) ;
1996-05-17 18:36:13 +02:00
# ifdef ASM_COMMENT_START
1998-10-14 18:15:09 +02:00
if ( flag_verbose_asm )
{
/* Print the list of options in effect. */
print_version ( asm_out_file , ASM_COMMENT_START ) ;
print_switch_values ( asm_out_file , 0 , MAX_LINE ,
1996-05-17 18:36:13 +02:00
ASM_COMMENT_START , " " , " \n " ) ;
1998-10-14 18:15:09 +02:00
/* Add a blank line here so it appears in assembler output but not
screen output . */
fprintf ( asm_out_file , " \n " ) ;
}
1998-01-20 09:55:07 +01:00
# endif
1992-02-06 00:20:23 +01:00
1998-10-14 18:15:09 +02:00
/* Output something to inform GDB that this compilation was by GCC. */
1992-02-06 00:20:23 +01:00
# ifndef ASM_IDENTIFY_GCC
1998-10-14 18:15:09 +02:00
fprintf ( asm_out_file , " gcc2_compiled.: \n " ) ;
1992-02-06 00:20:23 +01:00
# else
1998-10-14 18:15:09 +02:00
ASM_IDENTIFY_GCC ( asm_out_file ) ;
1992-02-06 00:20:23 +01:00
# endif
1993-03-25 09:51:26 +01:00
1996-07-04 00:07:53 +02:00
/* Output something to identify which front-end produced this file. */
1993-03-25 09:51:26 +01:00
# ifdef ASM_IDENTIFY_LANGUAGE
1998-10-14 18:15:09 +02:00
ASM_IDENTIFY_LANGUAGE ( asm_out_file ) ;
1993-03-25 09:51:26 +01:00
# endif
1998-10-14 18:15:09 +02:00
} /* ! flag_syntax_only */
1993-03-25 09:51:26 +01:00
1996-04-15 09:46:10 +02:00
# ifndef ASM_OUTPUT_SECTION_NAME
if ( flag_function_sections )
{
warning ( " -ffunction-sections not supported for this target. " ) ;
flag_function_sections = 0 ;
}
1998-09-30 10:26:10 +02:00
if ( flag_data_sections )
{
warning ( " -fdata-sections not supported for this target. " ) ;
flag_data_sections = 0 ;
}
1996-04-15 09:46:10 +02:00
# endif
if ( flag_function_sections
& & ( profile_flag | | profile_block_flag ) )
{
warning ( " -ffunction-sections disabled; it makes profiling impossible. " ) ;
flag_function_sections = 0 ;
}
1999-03-01 13:29:35 +01:00
# ifndef OBJECT_FORMAT_ELF
1996-04-15 09:46:10 +02:00
if ( flag_function_sections & & write_symbols ! = NO_DEBUG )
warning ( " -ffunction-sections may affect debugging on some targets. " ) ;
1999-03-01 13:29:35 +01:00
# endif
1996-04-15 09:46:10 +02:00
1998-01-20 09:55:07 +01:00
/* ??? Note: There used to be a conditional here
to call assemble_zeros without fail if DBX_DEBUGGING_INFO is defined .
This was to guarantee separation between gcc_compiled . and
the first function , for the sake of dbx on Suns .
However , having the extra zero here confused the Emacs
code for unexec , and might confuse other programs too .
Therefore , I took out that change .
In future versions we should find another way to solve
that dbx problem . - - rms , 23 May 93. */
1993-09-21 23:25:24 +02:00
1998-01-20 09:55:07 +01:00
/* Don't let the first function fall at the same address
as gcc_compiled . , if profiling . */
if ( profile_flag | | profile_block_flag )
1998-04-04 15:32:39 +02:00
{
/* It's best if we can write a nop here since some
assemblers don ' t tolerate zeros in the text section . */
1999-09-15 00:14:31 +02:00
output_asm_insn ( get_insn_template ( CODE_FOR_nop , NULL ) , NULL_PTR ) ;
1998-04-04 15:32:39 +02:00
}
1992-02-06 00:20:23 +01:00
/* If dbx symbol table desired, initialize writing it
and output the predefined types . */
1992-03-23 20:29:32 +01:00
# if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
if ( write_symbols = = DBX_DEBUG | | write_symbols = = XCOFF_DEBUG )
1992-02-06 00:20:23 +01:00
TIMEVAR ( symout_time , dbxout_init ( asm_out_file , main_input_filename ,
getdecls ( ) ) ) ;
# endif
# ifdef SDB_DEBUGGING_INFO
if ( write_symbols = = SDB_DEBUG )
TIMEVAR ( symout_time , sdbout_init ( asm_out_file , main_input_filename ,
getdecls ( ) ) ) ;
# endif
# ifdef DWARF_DEBUGGING_INFO
if ( write_symbols = = DWARF_DEBUG )
TIMEVAR ( symout_time , dwarfout_init ( asm_out_file , main_input_filename ) ) ;
# endif
1997-09-10 20:00:28 +02:00
# ifdef DWARF2_UNWIND_INFO
if ( dwarf2out_do_frame ( ) )
dwarf2out_frame_init ( ) ;
# endif
1996-11-15 08:14:08 +01:00
# ifdef DWARF2_DEBUGGING_INFO
if ( write_symbols = = DWARF2_DEBUG )
TIMEVAR ( symout_time , dwarf2out_init ( asm_out_file , main_input_filename ) ) ;
# endif
1992-02-06 00:20:23 +01:00
/* Initialize yet another pass. */
1998-01-20 09:55:07 +01:00
init_final ( main_input_filename ) ;
1997-03-28 23:40:07 +01:00
init_branch_prob ( dump_base_name ) ;
1992-02-06 00:20:23 +01:00
start_time = get_run_time ( ) ;
/* Call the parser, which parses the entire file
( calling rest_of_compilation for each function ) . */
if ( yyparse ( ) ! = 0 )
1994-01-25 00:59:48 +01:00
{
if ( errorcount = = 0 )
toplev.c (notice, [...]): Move to diagnostic.c
1999-12-18 Gabriel Dos Reis <gdr@codesourcery.com>
* toplev.c (notice, vmessage, v_message_with_file_and_line,
v_message_with_decl, file_and_line_for_asm,
v_error_with_file_and_line, v_error_with_decl, v_error_for_asm,
verror, vfatal, v_warning_with_file_and_line, v_warning_with_decl,
v_warning_for_asm, vwarning, vpedwarn, v_pedwarn_with_decl,
v_pedwarn_with_file_and_line, vsorry, vnotice, count_error,
pfatal_with_name, fatal_io_error, need_error_newline,
last_error_function, last_error_tick, announce_function,
default_print_error_function, print_error_function,
report_error_function, fnotice, error_with_file_and_line,
error_with_decl, error_for_asm, error, set_fatal_function, fatal,
_fatal_insn, _fatal_insn_not_found, warning_with_file_and_line,
warning_with_decl, warning_for_asm, warning, pedwarn,
pedwarn_with_decl, pedwarn_with_file_and_line, sorry): Move to
diagnostic.c
(compile_file): Use fnotice instead of notice. Adjust call.
* diagnostic.c: New file.
* Makefile.in (OBJS): Include diagnostic.o
(diagnostic.o): Define dependence.
From-SVN: r31003
1999-12-18 02:45:40 +01:00
fnotice ( stderr , " Errors detected in input file (your bison.simple is out of date) \n " ) ;
1994-01-25 00:59:48 +01:00
/* In case there were missing closebraces,
get us back to the global binding level . */
while ( ! global_bindings_p ( ) )
poplevel ( 0 , 0 , 0 ) ;
}
1992-02-06 00:20:23 +01:00
/* Compilation is now finished except for writing
what ' s left of the symbol table output . */
parse_time + = get_run_time ( ) - start_time ;
parse_time - = integration_time ;
parse_time - = varconst_time ;
1998-10-14 18:15:09 +02:00
if ( flag_syntax_only )
goto finish_syntax ;
1992-02-06 00:20:23 +01:00
globals = getdecls ( ) ;
/* Really define vars that have had only a tentative definition.
Really output inline functions that must actually be callable
and have not been output so far . */
{
int len = list_length ( globals ) ;
1999-11-08 05:56:18 +01:00
tree * vec = ( tree * ) xmalloc ( sizeof ( tree ) * len ) ;
1992-02-06 00:20:23 +01:00
int i ;
tree decl ;
/* Process the decls in reverse order--earliest first.
Put them into VEC from back to front , then take out from front . */
for ( i = 0 , decl = globals ; i < len ; i + + , decl = TREE_CHAIN ( decl ) )
vec [ len - i - 1 ] = decl ;
1999-04-23 01:06:09 +02:00
wrapup_global_declarations ( vec , len ) ;
1992-02-06 00:20:23 +01:00
1999-01-08 01:46:25 +01:00
/* This must occur after the loop to output deferred functions. Else
the profiler initializer would not be emitted if all the functions
in this compilation unit were deferred .
output_func_start_profiler can not cause any additional functions or
data to need to be output , so it need not be in the deferred function
loop above . */
output_func_start_profiler ( ) ;
1996-07-23 21:58:32 +02:00
/* Now that all possible functions have been output, we can dump
the exception table . */
1997-09-10 20:00:28 +02:00
output_exception_table ( ) ;
1999-04-26 18:02:57 +02:00
check_global_declarations ( vec , len ) ;
1999-11-08 05:56:18 +01:00
/* Clean up. */
free ( vec ) ;
1992-02-06 00:20:23 +01:00
}
1995-04-16 08:14:00 +02:00
/* Write out any pending weak symbol declarations. */
weak_finish ( ) ;
1992-02-06 00:20:23 +01:00
/* Do dbx symbols */
1992-03-23 20:29:32 +01:00
# if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
if ( write_symbols = = DBX_DEBUG | | write_symbols = = XCOFF_DEBUG )
1992-02-06 00:20:23 +01:00
TIMEVAR ( symout_time ,
{
dbxout_finish ( asm_out_file , main_input_filename ) ;
} ) ;
# endif
# ifdef DWARF_DEBUGGING_INFO
if ( write_symbols = = DWARF_DEBUG )
TIMEVAR ( symout_time ,
{
dwarfout_finish ( ) ;
} ) ;
# endif
1997-09-10 20:00:28 +02:00
# ifdef DWARF2_UNWIND_INFO
if ( dwarf2out_do_frame ( ) )
dwarf2out_frame_finish ( ) ;
# endif
1996-11-15 08:14:08 +01:00
# ifdef DWARF2_DEBUGGING_INFO
if ( write_symbols = = DWARF2_DEBUG )
TIMEVAR ( symout_time ,
{
dwarf2out_finish ( ) ;
} ) ;
# endif
1992-02-06 00:20:23 +01:00
/* Output some stuff at end of file if nec. */
1998-01-20 09:55:07 +01:00
end_final ( dump_base_name ) ;
1998-01-26 23:48:32 +01:00
if ( branch_prob_dump )
1999-10-05 06:04:48 +02:00
open_dump_file ( " .07.bp " , NULL ) ;
1998-01-26 23:48:32 +01:00
TIMEVAR ( dump_time , end_branch_prob ( rtl_dump_file ) ) ;
if ( branch_prob_dump )
close_dump_file ( NULL , NULL_RTX ) ;
1992-02-06 00:20:23 +01:00
# ifdef ASM_FILE_END
1998-01-20 09:55:07 +01:00
ASM_FILE_END ( asm_out_file ) ;
1992-02-06 00:20:23 +01:00
# endif
1998-10-28 11:22:48 +01:00
1992-02-06 00:20:23 +01:00
/* Language-specific end of compilation actions. */
1998-10-14 18:15:09 +02:00
finish_syntax :
1992-02-06 00:20:23 +01:00
lang_finish ( ) ;
/* Close the dump files. */
if ( flag_gen_aux_info )
{
fclose ( aux_info_file ) ;
if ( errorcount )
unlink ( aux_info_file_name ) ;
}
if ( combine_dump )
{
1999-10-05 06:04:48 +02:00
open_dump_file ( " .09.combine " , NULL ) ;
1998-01-26 23:48:32 +01:00
TIMEVAR ( dump_time , dump_combine_total_stats ( rtl_dump_file ) ) ;
close_dump_file ( NULL , NULL_RTX ) ;
1992-02-06 00:20:23 +01:00
}
/* Close non-debugging input and output files. Take special care to note
whether fclose returns an error , since the pages might still be on the
buffer chain while the file is open . */
1997-07-30 00:40:30 +02:00
finish_parse ( ) ;
1998-04-09 01:29:09 +02:00
1998-10-14 18:15:09 +02:00
if ( ! flag_syntax_only
& & ( ferror ( asm_out_file ) ! = 0 | | fclose ( asm_out_file ) ! = 0 ) )
1992-02-06 00:20:23 +01:00
fatal_io_error ( asm_file_name ) ;
1998-11-23 17:41:12 +01:00
/* Do whatever is necessary to finish printing the graphs. */
if ( graph_dump_format ! = no_graph )
{
if ( jump_opt_dump )
1999-10-05 06:04:48 +02:00
finish_graph_dump_file ( dump_base_name , " .01.jump " ) ;
1998-11-23 17:41:12 +01:00
if ( cse_dump )
1999-10-05 06:04:48 +02:00
finish_graph_dump_file ( dump_base_name , " .02.cse " ) ;
if ( addressof_dump )
finish_graph_dump_file ( dump_base_name , " .03.addressof " ) ;
if ( gcse_dump )
finish_graph_dump_file ( dump_base_name , " .04.gcse " ) ;
1998-11-23 17:41:12 +01:00
if ( loop_dump )
1999-10-05 06:04:48 +02:00
finish_graph_dump_file ( dump_base_name , " .05.loop " ) ;
1998-11-23 17:41:12 +01:00
if ( cse2_dump )
1999-10-05 06:04:48 +02:00
finish_graph_dump_file ( dump_base_name , " .06.cse2 " ) ;
1998-11-23 17:41:12 +01:00
if ( branch_prob_dump )
1999-10-05 06:04:48 +02:00
finish_graph_dump_file ( dump_base_name , " .07.bp " ) ;
1998-11-23 17:41:12 +01:00
if ( flow_dump )
1999-10-05 06:04:48 +02:00
finish_graph_dump_file ( dump_base_name , " .08.flow " ) ;
1998-11-23 17:41:12 +01:00
if ( combine_dump )
1999-10-05 06:04:48 +02:00
finish_graph_dump_file ( dump_base_name , " .09.combine " ) ;
1998-11-23 17:41:12 +01:00
if ( regmove_dump )
1999-10-05 06:04:48 +02:00
finish_graph_dump_file ( dump_base_name , " .10.regmove " ) ;
# ifdef INSN_SCHEDULING
1998-11-23 17:41:12 +01:00
if ( sched_dump )
1999-10-05 06:04:48 +02:00
finish_graph_dump_file ( dump_base_name , " .11.sched " ) ;
# endif
1998-11-23 17:41:12 +01:00
if ( local_reg_dump )
1999-10-05 06:04:48 +02:00
finish_graph_dump_file ( dump_base_name , " .12.lreg " ) ;
1998-11-23 17:41:12 +01:00
if ( global_reg_dump )
1999-10-05 06:04:48 +02:00
finish_graph_dump_file ( dump_base_name , " .13.greg " ) ;
if ( flow2_dump )
finish_graph_dump_file ( dump_base_name , " .14.flow2 " ) ;
# ifdef HAVE_peephole2
1999-04-07 00:56:16 +02:00
if ( flow2_dump )
1999-10-05 06:04:48 +02:00
finish_graph_dump_file ( dump_base_name , " .15.peephole2 " ) ;
# endif
# ifdef INSN_SCHEDULING
1998-11-23 17:41:12 +01:00
if ( sched2_dump )
1999-10-05 06:04:48 +02:00
finish_graph_dump_file ( dump_base_name , " .16.sched2 " ) ;
# endif
1998-11-23 17:41:12 +01:00
if ( jump2_opt_dump )
1999-10-05 06:04:48 +02:00
finish_graph_dump_file ( dump_base_name , " .17.jump2 " ) ;
# ifdef MACHINE_DEPENDENT_REORG
if ( mach_dep_reorg_dump )
finish_graph_dump_file ( dump_base_name , " .18.mach " ) ;
# endif
1998-11-23 17:41:12 +01:00
# ifdef DELAY_SLOTS
if ( dbr_sched_dump )
1999-10-05 06:04:48 +02:00
finish_graph_dump_file ( dump_base_name , " .19.dbr " ) ;
1998-11-23 17:41:12 +01:00
# endif
# ifdef STACK_REGS
if ( stack_reg_dump )
1999-10-05 06:04:48 +02:00
finish_graph_dump_file ( dump_base_name , " .20.stack " ) ;
1998-11-23 17:41:12 +01:00
# endif
}
1998-10-28 11:22:48 +01:00
/* Free up memory for the benefit of leak detectors. */
free_reg_info ( ) ;
1992-02-06 00:20:23 +01:00
/* Print the times. */
if ( ! quiet_flag )
{
1999-09-04 20:25:41 +02:00
all_time = get_run_time ( ) ;
1992-02-06 00:20:23 +01:00
fprintf ( stderr , " \n " ) ;
1993-09-21 23:25:24 +02:00
1999-09-04 20:25:41 +02:00
print_time ( " parse " , parse_time ) ;
1998-01-20 09:55:07 +01:00
print_time ( " integration " , integration_time ) ;
print_time ( " jump " , jump_time ) ;
print_time ( " cse " , cse_time ) ;
1998-05-20 02:24:32 +02:00
print_time ( " gcse " , gcse_time ) ;
1998-01-20 09:55:07 +01:00
print_time ( " loop " , loop_time ) ;
print_time ( " cse2 " , cse2_time ) ;
print_time ( " branch-prob " , branch_prob_time ) ;
print_time ( " flow " , flow_time ) ;
print_time ( " combine " , combine_time ) ;
print_time ( " regmove " , regmove_time ) ;
1999-10-05 06:04:48 +02:00
# ifdef INSN_SCHEDULING
1998-01-20 09:55:07 +01:00
print_time ( " sched " , sched_time ) ;
1999-10-05 06:04:48 +02:00
# endif
1998-01-20 09:55:07 +01:00
print_time ( " local-alloc " , local_alloc_time ) ;
print_time ( " global-alloc " , global_alloc_time ) ;
1999-02-26 00:45:42 +01:00
print_time ( " flow2 " , flow2_time ) ;
1999-10-05 06:04:48 +02:00
# ifdef HAVE_peephole2
print_time ( " peephole2 " , peephole2_time ) ;
# endif
# ifdef INSN_SCHEDULING
1998-01-20 09:55:07 +01:00
print_time ( " sched2 " , sched2_time ) ;
1999-10-05 06:04:48 +02:00
# endif
1998-03-03 11:06:54 +01:00
# ifdef DELAY_SLOTS
1998-01-20 09:55:07 +01:00
print_time ( " dbranch " , dbr_sched_time ) ;
1998-03-03 11:06:54 +01:00
# endif
1998-01-20 09:55:07 +01:00
print_time ( " shorten-branch " , shorten_branch_time ) ;
1999-10-05 06:04:48 +02:00
# ifdef STACK_REGS
1998-01-20 09:55:07 +01:00
print_time ( " stack-reg " , stack_reg_time ) ;
1999-10-05 06:04:48 +02:00
# endif
1998-01-20 09:55:07 +01:00
print_time ( " final " , final_time ) ;
print_time ( " varconst " , varconst_time ) ;
print_time ( " symout " , symout_time ) ;
print_time ( " dump " , dump_time ) ;
1999-10-05 06:04:48 +02:00
if ( ggc_p )
print_time ( " gc " , gc_time ) ;
1992-02-06 00:20:23 +01:00
}
}
/* This is called from various places for FUNCTION_DECL, VAR_DECL,
and TYPE_DECL nodes .
1999-09-24 10:05:28 +02:00
This does nothing for local ( non - static ) variables , unless the
variable is a register variable with an ASMSPEC . In that case , or
if the variable is not an automatice , it sets up the RTL and
outputs any assembler code ( label definition , storage allocation
and initialization ) .
1992-02-06 00:20:23 +01:00
DECL is the declaration . If ASMSPEC is nonzero , it specifies
the assembler symbol name to be used . TOP_LEVEL is nonzero
if this declaration is not within a function . */
void
rest_of_decl_compilation ( decl , asmspec , top_level , at_end )
tree decl ;
cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
* cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
Instead of writing to const char *buf directly, use a non-const
variable `wbuf' to allocate and write a string, then set buf = wbuf.
* cppulp.c (user_label_prefix): Qualify a char* with the `const'
keyword.
* dyn-string.c (dyn_string_append): Likewise.
* dyn-string.h (dyn_string_append): Likewise.
* final.c (end_final, output_operand_lossage, asm_fprintf): Likewise.
* output.h (end_final, output_operand_lossage, asm_fprintf,
named_section, decode_reg_name, make_decl_rtl, user_label_prefix):
Likewise.
* profile.c (init_branch_prob): Likewise.
* toplev.c (set_target_switch, vmessage,
v_message_with_file_and_line, v_message_with_decl,
v_error_with_file_and_line, v_error_with_decl, v_error_for_asm,
verror, vfatal, v_warning_with_file_and_line, v_warning_with_decl,
v_warning_for_asm, vwarning, vpedwarn, v_pedwarn_with_decl,
v_pedwarn_with_file_and_line, vsorry, v_really_sorry,
open_dump_file, dump_rtl, clean_dump_file,
print_version, print_single_switch, print_switch_values,
dump_base_name, debug_args, lang_independent_options,
user_label_prefix, documented_lang_options, target_switches,
target_options, print_time, pfatal_with_name, fatal_io_error,
fatal_insn, default_print_error_function, print_error_function,
report_error_function, error_with_file_and_line, error_with_decl,
error_for_asm, error, fatal, warning_with_file_and_line,
warning_with_decl, warning_for_asm, warning, pedwarn,
pedwarn_with_decl, pedwarn_with_file_and_line, sorry,
really_sorry, botch, output_quoted_string, output_file_directive,
open_dump_file, rest_of_decl_compilation, display_help, main):
Likewise.
* toplev.h (print_time, fatal, fatal_io_error, pfatal_with_name,
fatal_insn, warning, error, pedwarn, pedwarn_with_file_and_line,
warning_with_file_and_line, error_with_file_and_line, sorry,
really_sorry, default_print_error_function, report_error_function,
rest_of_decl_compilation, pedwarn_with_decl, warning_with_decl,
error_with_decl, error_for_asm, warning_for_asm, output_quoted_string,
output_file_directive, botch): Likewise.
* tree.h (make_decl_rtl): Likewise.
* varasm.c (strip_reg_name, named_section, decode_reg_name,
make_decl_rtl): Likewise.
From-SVN: r24743
1999-01-18 09:53:41 +01:00
const char * asmspec ;
1992-02-06 00:20:23 +01:00
int top_level ;
int at_end ;
{
/* Declarations of variables, and of functions defined elsewhere. */
1993-10-20 22:15:44 +01:00
/* The most obvious approach, to put an #ifndef around where
this macro is used , doesn ' t work since it ' s inside a macro call . */
# ifndef ASM_FINISH_DECLARE_OBJECT
# define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP, END)
# endif
1992-02-06 00:20:23 +01:00
/* Forward declarations for nested functions are not "external",
but we need to treat them as if they were . */
1992-07-12 04:43:19 +02:00
if ( TREE_STATIC ( decl ) | | DECL_EXTERNAL ( decl )
1992-02-06 00:20:23 +01:00
| | TREE_CODE ( decl ) = = FUNCTION_DECL )
TIMEVAR ( varconst_time ,
{
make_decl_rtl ( decl , asmspec , top_level ) ;
1993-08-08 10:33:22 +02:00
/* Initialized extern variable exists to be replaced
with its value , or represents something that will be
output in another file . */
1992-05-17 22:16:20 +02:00
if ( ! ( TREE_CODE ( decl ) = = VAR_DECL
1993-08-08 10:33:22 +02:00
& & DECL_EXTERNAL ( decl ) & & TREE_READONLY ( decl )
& & DECL_INITIAL ( decl ) ! = 0
1993-08-08 20:31:42 +02:00
& & DECL_INITIAL ( decl ) ! = error_mark_node ) )
1992-05-17 22:16:20 +02:00
/* Don't output anything
when a tentative file - scope definition is seen .
But at end of compilation , do output code for them . */
if ( ! ( ! at_end & & top_level
& & ( DECL_INITIAL ( decl ) = = 0
1993-08-08 10:33:22 +02:00
| | DECL_INITIAL ( decl ) = = error_mark_node ) ) )
1993-07-23 20:44:59 +02:00
assemble_variable ( decl , top_level , at_end , 0 ) ;
1998-01-20 09:55:07 +01:00
if ( decl = = last_assemble_variable_decl )
1993-10-24 08:06:49 +01:00
{
ASM_FINISH_DECLARE_OBJECT ( asm_out_file , decl ,
top_level , at_end ) ;
}
1992-02-06 00:20:23 +01:00
} ) ;
1992-07-12 04:43:19 +02:00
else if ( DECL_REGISTER ( decl ) & & asmspec ! = 0 )
1992-02-06 00:20:23 +01:00
{
if ( decode_reg_name ( asmspec ) > = 0 )
{
DECL_RTL ( decl ) = 0 ;
make_decl_rtl ( decl , asmspec , top_level ) ;
}
else
error ( " invalid register name `%s' for register variable " , asmspec ) ;
}
1992-03-23 20:29:32 +01:00
# if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
else if ( ( write_symbols = = DBX_DEBUG | | write_symbols = = XCOFF_DEBUG )
& & TREE_CODE ( decl ) = = TYPE_DECL )
1992-02-06 00:20:23 +01:00
TIMEVAR ( symout_time , dbxout_symbol ( decl , 0 ) ) ;
# endif
# ifdef SDB_DEBUGGING_INFO
else if ( write_symbols = = SDB_DEBUG & & top_level
& & TREE_CODE ( decl ) = = TYPE_DECL )
TIMEVAR ( symout_time , sdbout_symbol ( decl , 0 ) ) ;
# endif
}
/* Called after finishing a record, union or enumeral type. */
void
rest_of_type_compilation ( type , toplev )
Makefile.in (toplev.o): Depend on $(EXPR_H).
* Makefile.in (toplev.o): Depend on $(EXPR_H).
(insn-extract.o, insn-attrtab.o): Depend on toplev.h.
* gansidecl.h: Define ATTRIBUTE_NORETURN.
* genattrtab.c: Have insn-attrtab.c include toplev.h.
* genextract.c: Have insn-extract.c include toplev.h.
* rtl.h: Don't prototype `fatal_insn_not_found' and `fatal_insn'.
* toplev.c: Include expr.h.
(really_sorry, fancy_abort): Remove prototypes.
(set_target_switch): Add argument in prototype.
(vfatal): Mark prototype with ATTRIBUTE_NORETURN.
(v_really_sorry): Likewise.
(print_version, print_single_switch, print_switch_values): Make
static and add prototype arguments.
(decl_printable_name): Add prototype arguments.
(lang_expand_expr_t): New typedef.
(lang_expand_expr): Declare as a lang_expand_expr_t.
(incomplete_decl_finalize_hook): Add prototype argument.
(decl_name): Mark variable `verbosity' with ATTRIBUTE_UNUSED.
(botch): Likewise for variable `s'.
(rest_of_type_compilation): Mark variables `type' and `toplev'
with ATTRIBUTE_UNUSED if none of DBX_DEBUGGING_INFO,
XCOFF_DEBUGGING_INFO or SDB_DEBUGGING_INFO are defined.
(display_help): Make variable `i' an `unsigned long'.
(main): Remove unused parameter `envp'.
Cast assignment to `lang_expand_expr' to a `lang_expand_expr_t'.
Cast -1 when comparing it with a `size_t'.
* toplev.h (fatal, fatal_io_error, pfatal_with_name): Mark
prototype with ATTRIBUTE_NORETURN.
(fatal_insn_not_found, fatal_insn, really_sorry,
push_float_handler, pop_float_handler): Add prototypes.
(fancy_abort): Mark prototype with ATTRIBUTE_NORETURN.
(do_abort, botch): Add prototypes.
From-SVN: r22293
1998-09-06 07:56:20 +02:00
# if defined(DBX_DEBUGGING_INFO) || defined(XCOFF_DEBUGGING_INFO) || defined (SDB_DEBUGGING_INFO)
1992-02-06 00:20:23 +01:00
tree type ;
int toplev ;
Makefile.in (toplev.o): Depend on $(EXPR_H).
* Makefile.in (toplev.o): Depend on $(EXPR_H).
(insn-extract.o, insn-attrtab.o): Depend on toplev.h.
* gansidecl.h: Define ATTRIBUTE_NORETURN.
* genattrtab.c: Have insn-attrtab.c include toplev.h.
* genextract.c: Have insn-extract.c include toplev.h.
* rtl.h: Don't prototype `fatal_insn_not_found' and `fatal_insn'.
* toplev.c: Include expr.h.
(really_sorry, fancy_abort): Remove prototypes.
(set_target_switch): Add argument in prototype.
(vfatal): Mark prototype with ATTRIBUTE_NORETURN.
(v_really_sorry): Likewise.
(print_version, print_single_switch, print_switch_values): Make
static and add prototype arguments.
(decl_printable_name): Add prototype arguments.
(lang_expand_expr_t): New typedef.
(lang_expand_expr): Declare as a lang_expand_expr_t.
(incomplete_decl_finalize_hook): Add prototype argument.
(decl_name): Mark variable `verbosity' with ATTRIBUTE_UNUSED.
(botch): Likewise for variable `s'.
(rest_of_type_compilation): Mark variables `type' and `toplev'
with ATTRIBUTE_UNUSED if none of DBX_DEBUGGING_INFO,
XCOFF_DEBUGGING_INFO or SDB_DEBUGGING_INFO are defined.
(display_help): Make variable `i' an `unsigned long'.
(main): Remove unused parameter `envp'.
Cast assignment to `lang_expand_expr' to a `lang_expand_expr_t'.
Cast -1 when comparing it with a `size_t'.
* toplev.h (fatal, fatal_io_error, pfatal_with_name): Mark
prototype with ATTRIBUTE_NORETURN.
(fatal_insn_not_found, fatal_insn, really_sorry,
push_float_handler, pop_float_handler): Add prototypes.
(fancy_abort): Mark prototype with ATTRIBUTE_NORETURN.
(do_abort, botch): Add prototypes.
From-SVN: r22293
1998-09-06 07:56:20 +02:00
# else
tree type ATTRIBUTE_UNUSED ;
int toplev ATTRIBUTE_UNUSED ;
# endif
1992-02-06 00:20:23 +01:00
{
1992-03-23 20:29:32 +01:00
# if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
if ( write_symbols = = DBX_DEBUG | | write_symbols = = XCOFF_DEBUG )
1992-02-06 00:20:23 +01:00
TIMEVAR ( symout_time , dbxout_symbol ( TYPE_STUB_DECL ( type ) , ! toplev ) ) ;
# endif
# ifdef SDB_DEBUGGING_INFO
if ( write_symbols = = SDB_DEBUG )
TIMEVAR ( symout_time , sdbout_symbol ( TYPE_STUB_DECL ( type ) , ! toplev ) ) ;
# endif
}
1999-12-24 21:24:16 +01:00
/* DECL is an inline function, whose body is present, but which is not
being output at this point . ( We ' re putting that off until we need
to do it . ) If there are any actions that need to take place ,
including the emission of debugging information for the function ,
this is where they should go . This function may be called by
language - dependent code for front - ends that do not even generate
RTL for functions that don ' t need to be put out . */
void
note_deferral_of_defined_inline_function ( decl )
2000-01-09 15:23:35 +01:00
tree decl ATTRIBUTE_UNUSED ;
1999-12-24 21:24:16 +01:00
{
# ifdef DWARF_DEBUGGING_INFO
/* Generate the DWARF info for the "abstract" instance of a function
which we may later generate inlined and / or out - of - line instances
of . */
if ( write_symbols = = DWARF_DEBUG )
{
/* The front-end may not have set CURRENT_FUNCTION_DECL, but the
DWARF code expects it to be set in this case . Intuitively ,
DECL is the function we just finished defining , so setting
CURRENT_FUNCTION_DECL is sensible . */
tree saved_cfd = current_function_decl ;
current_function_decl = decl ;
/* Let the DWARF code do its work. */
set_decl_abstract_flags ( decl , 1 ) ;
dwarfout_file_scope_decl ( decl , 0 ) ;
set_decl_abstract_flags ( decl , 0 ) ;
/* Reset CURRENT_FUNCTION_DECL. */
current_function_decl = saved_cfd ;
}
# endif
}
1992-02-06 00:20:23 +01:00
/* This is called from finish_function (within yyparse)
after each top - level definition is parsed .
It is supposed to compile that function or variable
and output the assembler code for it .
After we return , the tree storage is freed . */
void
rest_of_compilation ( decl )
tree decl ;
{
register rtx insns ;
int start_time = get_run_time ( ) ;
int tem ;
1992-06-22 04:02:28 +02:00
int failure = 0 ;
1999-04-10 06:17:51 +02:00
int rebuild_label_notes_after_reload ;
1992-02-06 00:20:23 +01:00
2000-01-08 21:30:18 +01:00
/* When processing delayed functions, prepare_function_start() won't
have been run to re - initialize it . */
cse_not_expected = ! optimize ;
1999-11-04 00:18:57 +01:00
/* First, remove any notes we don't need. That will make iterating
over the instruction sequence faster , and allow the garbage
collector to reclaim the memory used by the notes . */
remove_unncessary_notes ( ) ;
1999-12-18 19:30:41 +01:00
/* In function-at-a-time mode, we do not attempt to keep the BLOCK
tree in sensible shape . So , we just recalculate it here . */
1999-12-20 14:18:17 +01:00
if ( cfun - > x_whole_function_mode_p )
1999-12-18 19:30:41 +01:00
{
find_loop_tree_blocks ( ) ;
unroll_block_trees ( ) ;
}
1992-02-06 00:20:23 +01:00
/* If we are reconsidering an inline function
at the end of compilation , skip the stuff for making it inline . */
if ( DECL_SAVED_INSNS ( decl ) = = 0 )
{
1997-12-07 01:31:01 +01:00
int inlinable = 0 ;
[multiple changes]
Fri Oct 29 15:25:07 1999 Arnaud Charlet <charlet@ACT-Europe.FR>
* gcov.c (DIR_SEPARATOR): Provide default.
(output_data): Add test for MS-DOS format absolute filename.
(fancy_abort): Correct program name.
(open_files): Open all files in binary mode.
* libgcc2.c (__bb_exit_func): Likewise.
* profile.c (init_branch_prob): Specify binary when opening files.
* flags.h (flag_unwind_tables): New decl.
* toplev.c (flag_unwind_table): New definition.
(f_options): Add -funwind-tables.
(decode_g_option): Clarify warning when unknown -g option is given.
(rest_of_compilation): If inside an inlined external function,
pretend we are just being declared.
* dwarf2out.c (dwarf2out_do_frame): Check -funwind_tables.
(dwarf2out_frame_finish): Likewise.
Fri Oct 29 06:32:44 1999 Geoffrey Keating <geoffk@cygnus.com>
* flow.c (propagate_block): When the last reference to a label
before an ADDR_VEC is deleted because the reference is a dead
store, delete the ADDR_VEC.
Fri Oct 29 07:44:26 1999 Vasco Pedro <vp@di.fct.unl.pt>
* fold-const.c (merge_ranges): In not in0, but in1, handle
upper bounds equal like subset case.
Thu Oct 28 19:22:24 1999 Douglas Rupp <rupp@gnat.com>
* dbxout.c (dbxout_parms): Generate a second stabs line for parameters
passed in a register but moved to the stack.
Thu Oct 28 19:12:57 1999 Sam Tardieu <tardieu@act-europe.fr>
* gcc.c (pass_exit_codes, greatest_status): New variables.
(struct option_map): Add entry for "--pass-exit-codes".
(execute): Update greatest_status if error.
(display_help): Add documentation for -pass-exit-codes.
(process_command): Handle -pass-exit-codes.
(main): Look at pass_exit_codes and greatest_status on call to exit.
Thu Oct 28 18:06:50 1999 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* reload.c (find_reloads): Refine test for no input reload
case to not includes reloads emitted after insn.
* function.c (find_temp_slots_from_address): Handle sum involving
a register that points to a temp slot.
(update_temp_slot_address): Make recursive call if both old and
new are PLUS with a common operand.
* calls.c (expand_call): Mark temp slot for result as having
address taken.
* rtlanal.c (reg_referenced_p, case IF_THEN_ELSE): New case.
* gcc.c (process_command): Add standard_exec_prefix with "GCC"
component as well as "BINUTILS".
* integrate.h (copy_rtx_and_substitute): New arg, FOR_LHS.
* integrate.c (copy_rtx_and_substitute): Likewise.
(expand_inline_function, integrate_parm_decls, integrate_decl_tree):
All callers changed.
* unroll.c (inital_reg_note_copy, copy_loop_body): Likewise.
* dbxout.c (dbxout_type, case INTEGER_TYPE_NODE): If can use
gdb extensions, write size of type; also be more consistent
in using references when this is a subtype.
* pa.md (extv, extzv, insv): Use define_expand to reject constant
that is out of range.
* loop.c (unknown_constant_address_altered): New variable.
(prescan_loop): Initialize it.
(note_addr_stored): Set it for RTX_UNCHANGING_P MEM.
(invariant_p, case MEM): Remove handling for volatile and readony;
check new variable if readonly.
(check_dbra_loop): Chdeck unknown_constant_address_altered.
* cse.c (canon_hash, case MEM): Do not record if BLKmode.
(addr_affects_sp_p): Removed from note_mem_written and only
define #ifdef AUTO_INC_DEC.
* alpha.c (input_operand, case ADDRESSOF): Treat as REG.
* regclass.c (record_reg_classes): Properly handle register move
directions.
* varasm.c (initializer_constant_valid_p, case MINUS_EXPR):
Don't think valid if both operands are invalid.
(struct constant_descriptor): New field RTL.
(mark_const_hash_entry): Mark it.
(record_constant{,_rtx}): Initialize it.
(output_constant_def): Allocate RTL in permanent obstack and
save in table.
({record,compare}_constant_1): Modes must match for
CONSTRUCTOR of ARRAY_TYPE.
* c-common.h (initializer_constant_valid_p): Delete decl from here.
* output.h (initializer_constant_valid_p): Move decl to here.
* c-common.c (initializer_constant_valid_p): Delete function from here.
* varasm.c (initializer_constant_valid_p): Move function to here.
* tree.h (STRIP_SIGN_NOPS): New macro.
* fold-const.c (optimize_minmax_comparison): New function.
(invert_truthvalue, case WITH_RECORD_EXPR): New case.
(fold): Use STRIP_SIGN_NOPS instead of STRIP_TYPE_NOPS.
(fold, case EQ_EXPR): Call optimize_minmax_comparison and add
cases with ABS_EXPR, NEGATE_EXPR, PLUS_EXPR, MINUS_EXPR, and
widening conversions.
(fold, case LE_EXPR): Rework changing unsigned to signed comparisons
to look at size of mode, not precision of type; also add missing cases.
(optimize_bit_field_compare, decode_field_reference): Don't try to
optimize COMPONENT_REF of a PLACEHOLDER_EXPR.
* dwarf2out.c (ctype.h): Include.
(dwarf2out_set_demangle_name_func): New function.
(size_of_line_info): Deleted.
(output_line_info): Compute size of line info table from difference
of labels.
(base_type_die, add_name_attribute): Call demangle function, if any.
(field_byte_offset): Use bits per word for variable length fields.
(gen_array_type_die): Add array name.
(gen_subprogram_die): Ignore DECL_INLINE if -fno-inline.
(dwarf2out_add_library_unit_info): New function.
* explow.c (set_stack_check_libfunc): New function.
(stack_check_libfunc): New static variable.
(probe_stack_range): Allow front-end to set up a libfunc to call.
* combine.c (simplify_comparison): When making comparison in wider
mode, check for having commuted an AND and a SUBREG.
(contains_muldiv): New function.
(try_combine): Call it when dividing a PARALLEL.
(simplify_rtx, case TRUNCATE): Don't remove for umulsi3_highpart.
(simplify_comparison, case ASHIFTRT): Recognize sign-extension of
a PLUS.
(record_value_for_reg): If TEM is a binary operation with two CLOBBERs,
use one of the CLOBBERs instead.
(if_then_else_cond): If comparing against zero, just return thing
being compared.
* optabs.c (expand_abs): If machine has MAX, ABS (x) is MAX (x, -x).
Don't generate shifts and subtract if have conditional arithmetic.
* rtl.h (delete_barrier): New declaration.
* jump.c (jump_optimize): Set up to handle conditional call.
In conditional arithmetic case, handle CALL_INSN followed by a BARRIER.
(delete_barrier): New function.
* rtl.c (read_rtx): Call fatal if bad RTL code; check for bad mode.
* recog.c (nonmemory_operand): Accept ADDRESSOF.
* tree.c (build_type_attribute_variant): Push to obstack of
ttype around type_hash_canon call.
* expr.c (placeholder_list): Move decl to file scope.
(expand_expr): Don't force access to volatile just because its
address is taken.
If ignoring reference operations, just expand the operands.
(expand_expr, case COMPONENT_REF): Propagate
EXPAND_CONST_ADDRESS to recursive call when expanding inner.
Refine test for using bitfield operations vs pointer punning.
(expand_expr, case CONVERT_EXPR): If converting to
BLKmode UNION_TYPE from BLKmode, just return inner object.
Use proper mode in store_field call.
Properly set sizes of object to store and total size in store_field
call for convert to union.
(expand_expr, case ARRAY_REF): If OP0 is in a register, put it in
memory (like for ADDR_EXPR). Also, don't put constant in register if
we'll want it in memory.
(readonly_fields_p): New function.
(expand_expr, case INDIRECT_REF): Call it if LHS.
(expand_assignment): Handle a RESULT_DECL where
DECL_RTL is a PARALLEL.
(do_jump, case WITH_RECORD_EXPR): New case.
(get_inner_reference): Always go inside a CONVERT_EXPR
and NOP_EXPR if both modes are the same.
(store_field): Use bitfield operations if size of bitsize is not same
as size of RHS's type.
Check for bitpos not a multiple of alignment in BLKmode case.
Do block move in largest possible alignment.
(store_constructor): Set BITSIZE to -1 for variable size and properly
in case of array of BLKmode.
(expand_expr_unaligned): New function.
(do_compare_and_jump): Call it.
* mips/iris5.h (SWITCHES_NEED_SPACES): New macro.
* collect2.c (main): Only allow -ofoo if SWITCHES_NEED_SPACES
does not include 'o'.
* function.c (instantiate_virtual_regs_1, case SET): Handle case where
both SET_DEST and SET_SRC reference a virtual register.
(gen_mem_addressof): Copy RTX_UNCHANGING_P from new REG to old REG.
* integrate.c (expand_inline_function): Handle case of setting
virtual stack vars register (from built in setjmp); when parameter
lives in memory, expand virtual_{stack_vars,incoming_args}_rtx early.
(subst_constant): Add new parm, MEMONLY.
(expand_inline_function, integrate_parm_decls): Pass new parm.
(integrate_decl_tree): Likewise.
(copy_rtx_and_substitute, case MEM): Do copy RTX_UNCHANGING_P.
(try_constants): Call subst_constants twice, with MEMONLY 0 and 1.
(copy_rtx_and_substitute, case SET): Add explicit calls to
copy_rtx_and_substitute for both sides.
* stmt.c (expand_asm_operands): Don't use TREE_STRING_LENGTH for
constraints.
(pushcase{,_range}): Convert to NOMINAL_TYPE after checking for
within INDEX_TYPE, instead of before.
(fixup_gotos): Use f->target_rtl, not the next insn,
since latter may be from a later fixup.
(expand_value_return): Correctly convert VAL when promoting function
return; support RETURN_REG being a PARALLEL.
(expand_return): When checking for result in regs and having
cleanup, consider PARALLEL in DECL_RTL as being in regs.
From-SVN: r30299
1999-11-01 02:11:22 +01:00
tree parent ;
c-aux-info.c (data_type, [...]): Qualify a char* with the `const' keyword.
* c-aux-info.c (data_type, affix_data_type, gen_decl,
gen_formal_list_for_type, gen_formal_list_for_func_def, gen_type):
Qualify a char* with the `const' keyword.
* c-common.c (declare_hidden_char_array, add_attribute, if_elt,
declare_function_name, decl_attributes, format_char_info,
check_format_info, binary_op_error): Likewise.
* cexp.y (yyerror, error, pedwarn, warning, token): Likewise.
* gcse.c (dump_hash_table): Likewise.
* integrate.c (function_cannot_inline_p): Likewise
* optabs.c: Include insn-config.h earlier.
(init_libfuncs, init_integral_libfuncs, init_floating_libfuncs):
Qualify a char* with the `const' keyword.
* real.c (asctoe24, asctoe53, asctoe64, asctoe113, asctoe,
asctoeg, mtherr, ereal_atof): Likewise.
* real.h (ereal_atof): Likewise.
* sbitmap.c (dump_sbitmap_vector): Likewise.
* sbitmap.h (dump_sbitmap_vector): Likewise.
* stmt.c (nesting, n_occurrences, expand_start_case): Likewise.
* toplev.c (rest_of_compilation): Likewise.
* tree.h (function_cannot_inline_p, expand_start_case): Likewise.
From-SVN: r25614
1999-03-06 06:34:26 +01:00
const char * lose ;
1992-02-06 00:20:23 +01:00
[multiple changes]
Fri Oct 29 15:25:07 1999 Arnaud Charlet <charlet@ACT-Europe.FR>
* gcov.c (DIR_SEPARATOR): Provide default.
(output_data): Add test for MS-DOS format absolute filename.
(fancy_abort): Correct program name.
(open_files): Open all files in binary mode.
* libgcc2.c (__bb_exit_func): Likewise.
* profile.c (init_branch_prob): Specify binary when opening files.
* flags.h (flag_unwind_tables): New decl.
* toplev.c (flag_unwind_table): New definition.
(f_options): Add -funwind-tables.
(decode_g_option): Clarify warning when unknown -g option is given.
(rest_of_compilation): If inside an inlined external function,
pretend we are just being declared.
* dwarf2out.c (dwarf2out_do_frame): Check -funwind_tables.
(dwarf2out_frame_finish): Likewise.
Fri Oct 29 06:32:44 1999 Geoffrey Keating <geoffk@cygnus.com>
* flow.c (propagate_block): When the last reference to a label
before an ADDR_VEC is deleted because the reference is a dead
store, delete the ADDR_VEC.
Fri Oct 29 07:44:26 1999 Vasco Pedro <vp@di.fct.unl.pt>
* fold-const.c (merge_ranges): In not in0, but in1, handle
upper bounds equal like subset case.
Thu Oct 28 19:22:24 1999 Douglas Rupp <rupp@gnat.com>
* dbxout.c (dbxout_parms): Generate a second stabs line for parameters
passed in a register but moved to the stack.
Thu Oct 28 19:12:57 1999 Sam Tardieu <tardieu@act-europe.fr>
* gcc.c (pass_exit_codes, greatest_status): New variables.
(struct option_map): Add entry for "--pass-exit-codes".
(execute): Update greatest_status if error.
(display_help): Add documentation for -pass-exit-codes.
(process_command): Handle -pass-exit-codes.
(main): Look at pass_exit_codes and greatest_status on call to exit.
Thu Oct 28 18:06:50 1999 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* reload.c (find_reloads): Refine test for no input reload
case to not includes reloads emitted after insn.
* function.c (find_temp_slots_from_address): Handle sum involving
a register that points to a temp slot.
(update_temp_slot_address): Make recursive call if both old and
new are PLUS with a common operand.
* calls.c (expand_call): Mark temp slot for result as having
address taken.
* rtlanal.c (reg_referenced_p, case IF_THEN_ELSE): New case.
* gcc.c (process_command): Add standard_exec_prefix with "GCC"
component as well as "BINUTILS".
* integrate.h (copy_rtx_and_substitute): New arg, FOR_LHS.
* integrate.c (copy_rtx_and_substitute): Likewise.
(expand_inline_function, integrate_parm_decls, integrate_decl_tree):
All callers changed.
* unroll.c (inital_reg_note_copy, copy_loop_body): Likewise.
* dbxout.c (dbxout_type, case INTEGER_TYPE_NODE): If can use
gdb extensions, write size of type; also be more consistent
in using references when this is a subtype.
* pa.md (extv, extzv, insv): Use define_expand to reject constant
that is out of range.
* loop.c (unknown_constant_address_altered): New variable.
(prescan_loop): Initialize it.
(note_addr_stored): Set it for RTX_UNCHANGING_P MEM.
(invariant_p, case MEM): Remove handling for volatile and readony;
check new variable if readonly.
(check_dbra_loop): Chdeck unknown_constant_address_altered.
* cse.c (canon_hash, case MEM): Do not record if BLKmode.
(addr_affects_sp_p): Removed from note_mem_written and only
define #ifdef AUTO_INC_DEC.
* alpha.c (input_operand, case ADDRESSOF): Treat as REG.
* regclass.c (record_reg_classes): Properly handle register move
directions.
* varasm.c (initializer_constant_valid_p, case MINUS_EXPR):
Don't think valid if both operands are invalid.
(struct constant_descriptor): New field RTL.
(mark_const_hash_entry): Mark it.
(record_constant{,_rtx}): Initialize it.
(output_constant_def): Allocate RTL in permanent obstack and
save in table.
({record,compare}_constant_1): Modes must match for
CONSTRUCTOR of ARRAY_TYPE.
* c-common.h (initializer_constant_valid_p): Delete decl from here.
* output.h (initializer_constant_valid_p): Move decl to here.
* c-common.c (initializer_constant_valid_p): Delete function from here.
* varasm.c (initializer_constant_valid_p): Move function to here.
* tree.h (STRIP_SIGN_NOPS): New macro.
* fold-const.c (optimize_minmax_comparison): New function.
(invert_truthvalue, case WITH_RECORD_EXPR): New case.
(fold): Use STRIP_SIGN_NOPS instead of STRIP_TYPE_NOPS.
(fold, case EQ_EXPR): Call optimize_minmax_comparison and add
cases with ABS_EXPR, NEGATE_EXPR, PLUS_EXPR, MINUS_EXPR, and
widening conversions.
(fold, case LE_EXPR): Rework changing unsigned to signed comparisons
to look at size of mode, not precision of type; also add missing cases.
(optimize_bit_field_compare, decode_field_reference): Don't try to
optimize COMPONENT_REF of a PLACEHOLDER_EXPR.
* dwarf2out.c (ctype.h): Include.
(dwarf2out_set_demangle_name_func): New function.
(size_of_line_info): Deleted.
(output_line_info): Compute size of line info table from difference
of labels.
(base_type_die, add_name_attribute): Call demangle function, if any.
(field_byte_offset): Use bits per word for variable length fields.
(gen_array_type_die): Add array name.
(gen_subprogram_die): Ignore DECL_INLINE if -fno-inline.
(dwarf2out_add_library_unit_info): New function.
* explow.c (set_stack_check_libfunc): New function.
(stack_check_libfunc): New static variable.
(probe_stack_range): Allow front-end to set up a libfunc to call.
* combine.c (simplify_comparison): When making comparison in wider
mode, check for having commuted an AND and a SUBREG.
(contains_muldiv): New function.
(try_combine): Call it when dividing a PARALLEL.
(simplify_rtx, case TRUNCATE): Don't remove for umulsi3_highpart.
(simplify_comparison, case ASHIFTRT): Recognize sign-extension of
a PLUS.
(record_value_for_reg): If TEM is a binary operation with two CLOBBERs,
use one of the CLOBBERs instead.
(if_then_else_cond): If comparing against zero, just return thing
being compared.
* optabs.c (expand_abs): If machine has MAX, ABS (x) is MAX (x, -x).
Don't generate shifts and subtract if have conditional arithmetic.
* rtl.h (delete_barrier): New declaration.
* jump.c (jump_optimize): Set up to handle conditional call.
In conditional arithmetic case, handle CALL_INSN followed by a BARRIER.
(delete_barrier): New function.
* rtl.c (read_rtx): Call fatal if bad RTL code; check for bad mode.
* recog.c (nonmemory_operand): Accept ADDRESSOF.
* tree.c (build_type_attribute_variant): Push to obstack of
ttype around type_hash_canon call.
* expr.c (placeholder_list): Move decl to file scope.
(expand_expr): Don't force access to volatile just because its
address is taken.
If ignoring reference operations, just expand the operands.
(expand_expr, case COMPONENT_REF): Propagate
EXPAND_CONST_ADDRESS to recursive call when expanding inner.
Refine test for using bitfield operations vs pointer punning.
(expand_expr, case CONVERT_EXPR): If converting to
BLKmode UNION_TYPE from BLKmode, just return inner object.
Use proper mode in store_field call.
Properly set sizes of object to store and total size in store_field
call for convert to union.
(expand_expr, case ARRAY_REF): If OP0 is in a register, put it in
memory (like for ADDR_EXPR). Also, don't put constant in register if
we'll want it in memory.
(readonly_fields_p): New function.
(expand_expr, case INDIRECT_REF): Call it if LHS.
(expand_assignment): Handle a RESULT_DECL where
DECL_RTL is a PARALLEL.
(do_jump, case WITH_RECORD_EXPR): New case.
(get_inner_reference): Always go inside a CONVERT_EXPR
and NOP_EXPR if both modes are the same.
(store_field): Use bitfield operations if size of bitsize is not same
as size of RHS's type.
Check for bitpos not a multiple of alignment in BLKmode case.
Do block move in largest possible alignment.
(store_constructor): Set BITSIZE to -1 for variable size and properly
in case of array of BLKmode.
(expand_expr_unaligned): New function.
(do_compare_and_jump): Call it.
* mips/iris5.h (SWITCHES_NEED_SPACES): New macro.
* collect2.c (main): Only allow -ofoo if SWITCHES_NEED_SPACES
does not include 'o'.
* function.c (instantiate_virtual_regs_1, case SET): Handle case where
both SET_DEST and SET_SRC reference a virtual register.
(gen_mem_addressof): Copy RTX_UNCHANGING_P from new REG to old REG.
* integrate.c (expand_inline_function): Handle case of setting
virtual stack vars register (from built in setjmp); when parameter
lives in memory, expand virtual_{stack_vars,incoming_args}_rtx early.
(subst_constant): Add new parm, MEMONLY.
(expand_inline_function, integrate_parm_decls): Pass new parm.
(integrate_decl_tree): Likewise.
(copy_rtx_and_substitute, case MEM): Do copy RTX_UNCHANGING_P.
(try_constants): Call subst_constants twice, with MEMONLY 0 and 1.
(copy_rtx_and_substitute, case SET): Add explicit calls to
copy_rtx_and_substitute for both sides.
* stmt.c (expand_asm_operands): Don't use TREE_STRING_LENGTH for
constraints.
(pushcase{,_range}): Convert to NOMINAL_TYPE after checking for
within INDEX_TYPE, instead of before.
(fixup_gotos): Use f->target_rtl, not the next insn,
since latter may be from a later fixup.
(expand_value_return): Correctly convert VAL when promoting function
return; support RETURN_REG being a PARALLEL.
(expand_return): When checking for result in regs and having
cleanup, consider PARALLEL in DECL_RTL as being in regs.
From-SVN: r30299
1999-11-01 02:11:22 +01:00
/* If this is nested inside an inlined external function, pretend
it was only declared . Since we cannot inline such functions ,
generating code for this one is not only not necessary but will
confuse some debugging output writers . */
for ( parent = DECL_CONTEXT ( current_function_decl ) ;
1999-11-08 16:27:56 +01:00
parent ! = NULL_TREE ;
parent = get_containing_scope ( parent ) )
1999-11-01 07:42:00 +01:00
if ( TREE_CODE ( parent ) = = FUNCTION_DECL
& & DECL_INLINE ( parent ) & & DECL_EXTERNAL ( parent ) )
[multiple changes]
Fri Oct 29 15:25:07 1999 Arnaud Charlet <charlet@ACT-Europe.FR>
* gcov.c (DIR_SEPARATOR): Provide default.
(output_data): Add test for MS-DOS format absolute filename.
(fancy_abort): Correct program name.
(open_files): Open all files in binary mode.
* libgcc2.c (__bb_exit_func): Likewise.
* profile.c (init_branch_prob): Specify binary when opening files.
* flags.h (flag_unwind_tables): New decl.
* toplev.c (flag_unwind_table): New definition.
(f_options): Add -funwind-tables.
(decode_g_option): Clarify warning when unknown -g option is given.
(rest_of_compilation): If inside an inlined external function,
pretend we are just being declared.
* dwarf2out.c (dwarf2out_do_frame): Check -funwind_tables.
(dwarf2out_frame_finish): Likewise.
Fri Oct 29 06:32:44 1999 Geoffrey Keating <geoffk@cygnus.com>
* flow.c (propagate_block): When the last reference to a label
before an ADDR_VEC is deleted because the reference is a dead
store, delete the ADDR_VEC.
Fri Oct 29 07:44:26 1999 Vasco Pedro <vp@di.fct.unl.pt>
* fold-const.c (merge_ranges): In not in0, but in1, handle
upper bounds equal like subset case.
Thu Oct 28 19:22:24 1999 Douglas Rupp <rupp@gnat.com>
* dbxout.c (dbxout_parms): Generate a second stabs line for parameters
passed in a register but moved to the stack.
Thu Oct 28 19:12:57 1999 Sam Tardieu <tardieu@act-europe.fr>
* gcc.c (pass_exit_codes, greatest_status): New variables.
(struct option_map): Add entry for "--pass-exit-codes".
(execute): Update greatest_status if error.
(display_help): Add documentation for -pass-exit-codes.
(process_command): Handle -pass-exit-codes.
(main): Look at pass_exit_codes and greatest_status on call to exit.
Thu Oct 28 18:06:50 1999 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* reload.c (find_reloads): Refine test for no input reload
case to not includes reloads emitted after insn.
* function.c (find_temp_slots_from_address): Handle sum involving
a register that points to a temp slot.
(update_temp_slot_address): Make recursive call if both old and
new are PLUS with a common operand.
* calls.c (expand_call): Mark temp slot for result as having
address taken.
* rtlanal.c (reg_referenced_p, case IF_THEN_ELSE): New case.
* gcc.c (process_command): Add standard_exec_prefix with "GCC"
component as well as "BINUTILS".
* integrate.h (copy_rtx_and_substitute): New arg, FOR_LHS.
* integrate.c (copy_rtx_and_substitute): Likewise.
(expand_inline_function, integrate_parm_decls, integrate_decl_tree):
All callers changed.
* unroll.c (inital_reg_note_copy, copy_loop_body): Likewise.
* dbxout.c (dbxout_type, case INTEGER_TYPE_NODE): If can use
gdb extensions, write size of type; also be more consistent
in using references when this is a subtype.
* pa.md (extv, extzv, insv): Use define_expand to reject constant
that is out of range.
* loop.c (unknown_constant_address_altered): New variable.
(prescan_loop): Initialize it.
(note_addr_stored): Set it for RTX_UNCHANGING_P MEM.
(invariant_p, case MEM): Remove handling for volatile and readony;
check new variable if readonly.
(check_dbra_loop): Chdeck unknown_constant_address_altered.
* cse.c (canon_hash, case MEM): Do not record if BLKmode.
(addr_affects_sp_p): Removed from note_mem_written and only
define #ifdef AUTO_INC_DEC.
* alpha.c (input_operand, case ADDRESSOF): Treat as REG.
* regclass.c (record_reg_classes): Properly handle register move
directions.
* varasm.c (initializer_constant_valid_p, case MINUS_EXPR):
Don't think valid if both operands are invalid.
(struct constant_descriptor): New field RTL.
(mark_const_hash_entry): Mark it.
(record_constant{,_rtx}): Initialize it.
(output_constant_def): Allocate RTL in permanent obstack and
save in table.
({record,compare}_constant_1): Modes must match for
CONSTRUCTOR of ARRAY_TYPE.
* c-common.h (initializer_constant_valid_p): Delete decl from here.
* output.h (initializer_constant_valid_p): Move decl to here.
* c-common.c (initializer_constant_valid_p): Delete function from here.
* varasm.c (initializer_constant_valid_p): Move function to here.
* tree.h (STRIP_SIGN_NOPS): New macro.
* fold-const.c (optimize_minmax_comparison): New function.
(invert_truthvalue, case WITH_RECORD_EXPR): New case.
(fold): Use STRIP_SIGN_NOPS instead of STRIP_TYPE_NOPS.
(fold, case EQ_EXPR): Call optimize_minmax_comparison and add
cases with ABS_EXPR, NEGATE_EXPR, PLUS_EXPR, MINUS_EXPR, and
widening conversions.
(fold, case LE_EXPR): Rework changing unsigned to signed comparisons
to look at size of mode, not precision of type; also add missing cases.
(optimize_bit_field_compare, decode_field_reference): Don't try to
optimize COMPONENT_REF of a PLACEHOLDER_EXPR.
* dwarf2out.c (ctype.h): Include.
(dwarf2out_set_demangle_name_func): New function.
(size_of_line_info): Deleted.
(output_line_info): Compute size of line info table from difference
of labels.
(base_type_die, add_name_attribute): Call demangle function, if any.
(field_byte_offset): Use bits per word for variable length fields.
(gen_array_type_die): Add array name.
(gen_subprogram_die): Ignore DECL_INLINE if -fno-inline.
(dwarf2out_add_library_unit_info): New function.
* explow.c (set_stack_check_libfunc): New function.
(stack_check_libfunc): New static variable.
(probe_stack_range): Allow front-end to set up a libfunc to call.
* combine.c (simplify_comparison): When making comparison in wider
mode, check for having commuted an AND and a SUBREG.
(contains_muldiv): New function.
(try_combine): Call it when dividing a PARALLEL.
(simplify_rtx, case TRUNCATE): Don't remove for umulsi3_highpart.
(simplify_comparison, case ASHIFTRT): Recognize sign-extension of
a PLUS.
(record_value_for_reg): If TEM is a binary operation with two CLOBBERs,
use one of the CLOBBERs instead.
(if_then_else_cond): If comparing against zero, just return thing
being compared.
* optabs.c (expand_abs): If machine has MAX, ABS (x) is MAX (x, -x).
Don't generate shifts and subtract if have conditional arithmetic.
* rtl.h (delete_barrier): New declaration.
* jump.c (jump_optimize): Set up to handle conditional call.
In conditional arithmetic case, handle CALL_INSN followed by a BARRIER.
(delete_barrier): New function.
* rtl.c (read_rtx): Call fatal if bad RTL code; check for bad mode.
* recog.c (nonmemory_operand): Accept ADDRESSOF.
* tree.c (build_type_attribute_variant): Push to obstack of
ttype around type_hash_canon call.
* expr.c (placeholder_list): Move decl to file scope.
(expand_expr): Don't force access to volatile just because its
address is taken.
If ignoring reference operations, just expand the operands.
(expand_expr, case COMPONENT_REF): Propagate
EXPAND_CONST_ADDRESS to recursive call when expanding inner.
Refine test for using bitfield operations vs pointer punning.
(expand_expr, case CONVERT_EXPR): If converting to
BLKmode UNION_TYPE from BLKmode, just return inner object.
Use proper mode in store_field call.
Properly set sizes of object to store and total size in store_field
call for convert to union.
(expand_expr, case ARRAY_REF): If OP0 is in a register, put it in
memory (like for ADDR_EXPR). Also, don't put constant in register if
we'll want it in memory.
(readonly_fields_p): New function.
(expand_expr, case INDIRECT_REF): Call it if LHS.
(expand_assignment): Handle a RESULT_DECL where
DECL_RTL is a PARALLEL.
(do_jump, case WITH_RECORD_EXPR): New case.
(get_inner_reference): Always go inside a CONVERT_EXPR
and NOP_EXPR if both modes are the same.
(store_field): Use bitfield operations if size of bitsize is not same
as size of RHS's type.
Check for bitpos not a multiple of alignment in BLKmode case.
Do block move in largest possible alignment.
(store_constructor): Set BITSIZE to -1 for variable size and properly
in case of array of BLKmode.
(expand_expr_unaligned): New function.
(do_compare_and_jump): Call it.
* mips/iris5.h (SWITCHES_NEED_SPACES): New macro.
* collect2.c (main): Only allow -ofoo if SWITCHES_NEED_SPACES
does not include 'o'.
* function.c (instantiate_virtual_regs_1, case SET): Handle case where
both SET_DEST and SET_SRC reference a virtual register.
(gen_mem_addressof): Copy RTX_UNCHANGING_P from new REG to old REG.
* integrate.c (expand_inline_function): Handle case of setting
virtual stack vars register (from built in setjmp); when parameter
lives in memory, expand virtual_{stack_vars,incoming_args}_rtx early.
(subst_constant): Add new parm, MEMONLY.
(expand_inline_function, integrate_parm_decls): Pass new parm.
(integrate_decl_tree): Likewise.
(copy_rtx_and_substitute, case MEM): Do copy RTX_UNCHANGING_P.
(try_constants): Call subst_constants twice, with MEMONLY 0 and 1.
(copy_rtx_and_substitute, case SET): Add explicit calls to
copy_rtx_and_substitute for both sides.
* stmt.c (expand_asm_operands): Don't use TREE_STRING_LENGTH for
constraints.
(pushcase{,_range}): Convert to NOMINAL_TYPE after checking for
within INDEX_TYPE, instead of before.
(fixup_gotos): Use f->target_rtl, not the next insn,
since latter may be from a later fixup.
(expand_value_return): Correctly convert VAL when promoting function
return; support RETURN_REG being a PARALLEL.
(expand_return): When checking for result in regs and having
cleanup, consider PARALLEL in DECL_RTL as being in regs.
From-SVN: r30299
1999-11-01 02:11:22 +01:00
{
DECL_INITIAL ( decl ) = 0 ;
goto exit_rest_of_compilation ;
}
1992-02-06 00:20:23 +01:00
/* If requested, consider whether to make this function inline. */
1995-12-31 21:03:51 +01:00
if ( DECL_INLINE ( decl ) | | flag_inline_functions )
1992-02-06 00:20:23 +01:00
TIMEVAR ( integration_time ,
{
lose = function_cannot_inline_p ( decl ) ;
1993-08-05 07:45:32 +02:00
if ( lose | | ! optimize )
1992-02-06 00:20:23 +01:00
{
1995-12-31 21:03:51 +01:00
if ( warn_inline & & DECL_INLINE ( decl ) )
1992-02-06 00:20:23 +01:00
warning_with_decl ( decl , lose ) ;
1994-07-19 04:08:23 +02:00
DECL_ABSTRACT_ORIGIN ( decl ) = 0 ;
1993-07-17 06:48:10 +02:00
/* Don't really compile an extern inline function.
If we can ' t make it inline , pretend
it was only declared . */
if ( DECL_EXTERNAL ( decl ) )
1993-10-30 09:33:12 +01:00
{
DECL_INITIAL ( decl ) = 0 ;
goto exit_rest_of_compilation ;
}
1992-02-06 00:20:23 +01:00
}
else
1995-12-31 21:03:51 +01:00
/* ??? Note that this has the effect of making it look
like " inline " was specified for a function if we choose
to inline it . This isn ' t quite right , but it ' s
probably not worth the trouble to fix . */
1997-12-07 01:31:01 +01:00
inlinable = DECL_INLINE ( decl ) = 1 ;
1992-02-06 00:20:23 +01:00
} ) ;
insns = get_insns ( ) ;
/* Dump the rtl code if we are dumping rtl. */
if ( rtl_dump )
1998-01-26 23:48:32 +01:00
{
1999-10-05 06:04:48 +02:00
open_dump_file ( " .00.rtl " , decl_printable_name ( decl , 2 ) ) ;
1998-01-26 23:48:32 +01:00
if ( DECL_SAVED_INSNS ( decl ) )
fprintf ( rtl_dump_file , " ;; (integrable) \n \n " ) ;
close_dump_file ( print_rtl , insns ) ;
}
1992-02-06 00:20:23 +01:00
/* If function is inline, and we don't yet know whether to
compile it by itself , defer decision till end of compilation .
finish_compilation will call rest_of_compilation again
1994-01-23 14:13:51 +01:00
for those functions that need to be output . Also defer those
1999-09-04 15:09:56 +02:00
functions that we are supposed to defer . */
1997-12-07 01:31:01 +01:00
if ( inlinable )
1999-09-04 15:09:56 +02:00
DECL_DEFER_OUTPUT ( decl ) = 1 ;
1997-11-02 22:19:36 +01:00
1999-09-04 15:09:56 +02:00
if ( DECL_DEFER_OUTPUT ( decl )
| | ( DECL_INLINE ( decl )
& & ( ( ! TREE_PUBLIC ( decl ) & & ! TREE_ADDRESSABLE ( decl )
& & ! flag_keep_inline_functions )
| | DECL_EXTERNAL ( decl ) ) ) )
1992-02-06 00:20:23 +01:00
{
1995-03-18 12:43:35 +01:00
DECL_DEFER_OUTPUT ( decl ) = 1 ;
1997-12-15 18:55:11 +01:00
/* If -Wreturn-type, we have to do a bit of compilation.
However , if we just fall through we will call
save_for_inline_copying ( ) which results in excessive
memory use . Instead , we just want to call
jump_optimize ( ) to figure out whether or not we can fall
off the end of the function ; we do the minimum amount of
work necessary to make that safe . And , we set optimize
to zero to keep jump_optimize from working too hard . */
if ( warn_return_type )
1992-07-17 06:21:19 +02:00
{
1997-12-15 18:55:11 +01:00
int saved_optimize = optimize ;
optimize = 0 ;
find_exception_handler_labels ( ) ;
1998-04-27 08:05:55 +02:00
jump_optimize ( get_insns ( ) , ! JUMP_CROSS_JUMP , ! JUMP_NOOP_MOVES ,
! JUMP_AFTER_REGSCAN ) ;
1997-12-15 18:55:11 +01:00
optimize = saved_optimize ;
}
1999-12-24 21:24:16 +01:00
note_deferral_of_defined_inline_function ( decl ) ;
1997-12-15 18:55:11 +01:00
TIMEVAR ( integration_time , save_for_inline_nocopy ( decl ) ) ;
1999-08-09 16:00:21 +02:00
DECL_SAVED_INSNS ( decl ) - > inlinable = inlinable ;
1997-12-15 18:55:11 +01:00
goto exit_rest_of_compilation ;
1992-02-06 00:20:23 +01:00
}
1994-12-21 19:29:03 +01:00
/* If specified extern inline but we aren't inlining it, we are
1998-09-21 16:11:35 +02:00
done . This goes for anything that gets here with DECL_EXTERNAL
set , not just things with DECL_INLINE . */
if ( DECL_EXTERNAL ( decl ) )
1994-12-21 19:29:03 +01:00
goto exit_rest_of_compilation ;
}
1994-06-17 01:37:53 +02:00
1999-08-09 16:00:21 +02:00
/* Initialize some variables used by the optimizers. */
init_function_for_compilation ( ) ;
1995-03-18 12:43:35 +01:00
if ( ! DECL_DEFER_OUTPUT ( decl ) )
TREE_ASM_WRITTEN ( decl ) = 1 ;
1992-02-06 00:20:23 +01:00
/* Now that integrate will no longer see our rtl, we need not distinguish
between the return value of this function and the return value of called
functions . */
rtx_equal_function_value_matters = 0 ;
1992-04-18 00:17:33 +02:00
/* Don't return yet if -Wreturn-type; we need to do jump_optimize. */
if ( ( rtl_dump_and_exit | | flag_syntax_only ) & & ! warn_return_type )
1992-02-06 00:20:23 +01:00
{
goto exit_rest_of_compilation ;
}
[multiple changes]
Thu Dec 11 20:42:18 1997 Teemu Torma <tot@trema.com>
Thread-safe EH support for pthreads, DCE threads and Solaris threads.
* integrate.c (expand_inline_function): If the inline fn uses eh
context, make sure that the current fn has one.
* toplev.c (rest_of_compilation): Call emit_eh_context.
* except.c (use_eh_context): New fn.
(get_eh_context_once): New fn.
(call_get_eh_context): New fn.
(emit_eh_context): New fn.
(get_eh_context): Call either get_eh_context_once or
call_get_eh_context, depending on what we have.
(get_dynamic_handler_chain): Call get_eh_context_once.
* except.h: Prototypes for fns above.
* optabs.c (get_eh_context_libfunc): Removed.
(init_optabs): Don't initialize it.
* expr.h (get_eh_context_libfunc): Removed.
* rtl.h, rtl.c: New reg_note REG_EH_CONTEXT.
* config/pa/pa.h (CPP_SPEC): Support for -threads.
* config/pa/pa-hpux10.h (LIB_SPEC): Ditto.
* config/pa/t-pa (MULTILIB_OPTIONS, MULTILIB_DIRNAMES):
New multilib for -threads.
* config/sparc/t-sol2: Added multilibs for -threads and
made -pthreads alias to it.
* config/sparc/sol2.h (CPP_SPEC, LIB_SPEC):
Added -threads and -pthreads options.
* libgcc-thr.h: New file.
* libgcc2.c: (__get_cpp_eh_context): Removed.
(struct cpp_eh_context): Removed.
(struct eh_context): Replaced cpp_eh_context with generic language
specific pointer.
(__get_eh_info): New function.
(__throw): Check eh_context::info.
(__sjthrow): Ditto.
* libgcc2.c: Include libgcc-thr.h.
(new_eh_context, __get_eh_context,
eh_pthread_initialize, eh_context_initialize, eh_context_static,
eh_context_specific, eh_context_free): New functions.
(get_eh_context, eh_context_key): New variables.
(__sjthrow, __sjpopnthrow, __eh_pcnthrow, __throw): Use
get_eh_context to get the context.
(longjmp): Move the declaration inside
#ifdef DONT_USE_BUILTIN_SETJMP.
* frame.c: Include libgcc-thr.h.
(object_mutex): Mutex to protect the object list.
(find_fde, __register_frame, __register_frame_table,
__deregister_frame): Hold the lock while accessing objects.
* except.h (get_eh_context): Declare.
* except.c (current_function_ehc): Define.
(current_function_dhc, current_function_dcc): Removed.
(get_eh_context): New function.
(get_dynamic_handler_chain): Use get_eh_context.
(get_saved_pc_ref): Ditto.
(get_dynamic_cleanup_chain): Removed references to
current_function_dcc.
(save_eh_status, restore_eh_status): Save and restore
current_function_ehc instead.
* optabs.c (get_eh_context_libfunc): New variable.
(init_optabs): Initialize it.
* expr.h: Declare get_eh_context_libfunc.
* function.h (struct function): Replaced dhc and dcc with ehc.
* except.c (get_saved_pc_ref): New functions.
(eh_saved_pc_rtx, eh_saved_pc): Deleted.
(expand_internal_throw_indirect): Use get_saved_pc_ref() instead
of eh_saved_pc.
(end_eh_unwinder): Likewise.
(init_eh): Remove initialization of eh_saved_pc.
* optabs.c (get_saved_pc_libfunc): New variable.
(init_optabs): Initialize it.
* expr.h: Declare get_saved_pc_libfunc.
* except.h (eh_saved_pc_rtx): Deleted.
(get_saved_pc_ref): Declared.
From Scott Snyder <snyder@d0sgif.fnal.gov>:
* libgcc2.c (__get_saved_pc): New.
(__eh_type, __eh_pc): Deleted.
(__eh_pcnthrow): Use __get_saved_pc() instead of __eh_pc.
(__get_dynamic_handler_chain): Move __dynamic_handler_chain inside
this fcn.
cp/:
Thu Dec 11 20:43:33 1997 Teemu Torma <tot@trema.com>
* decl.c (ptr_ptr_type_node): Define.
(init_decl_processing): Initialize it.
* cp-tree.h: Declare it.
* exception.cc (__cp_exception_info): Use __get_eh_info.
(__cp_push_exception): Ditto.
(__cp_pop_exception): Ditto.
From Scott Snyder <snyder@d0sgif.fnal.gov>:
* except.c (expand_builtin_throw): Use get_saved_pc_ref instead of
saved_pc.
(init_exception_processing): Removed saved_pc initialization.
From-SVN: r17052
1997-12-12 05:53:20 +01:00
/* Emit code to get eh context, if needed. */
emit_eh_context ( ) ;
1992-02-06 00:20:23 +01:00
# ifdef FINALIZE_PIC
/* If we are doing position-independent code generation, now
is the time to output special prologues and epilogues .
We do not want to do this earlier , because it just clutters
up inline functions with meaningless insns . */
if ( flag_pic )
FINALIZE_PIC ;
# endif
1996-12-12 01:30:15 +01:00
/* From now on, allocate rtl in current_obstack, not in saveable_obstack.
Note that that may have been done above , in save_for_inline_copying .
The call to resume_temporary_allocation near the end of this function
goes back to the usual state of affairs . This must be done after
we ' ve built up any unwinders for exception handling , and done
the FINALIZE_PIC work , if necessary . */
rtl_in_current_obstack ( ) ;
1996-07-23 21:58:32 +02:00
1992-02-06 00:20:23 +01:00
insns = get_insns ( ) ;
/* Copy any shared structure that should not be shared. */
unshare_all_rtl ( insns ) ;
lists.c (unused_insn_list, [...]): New file for maintaining various types of lists.
Wed Aug 25 13:41:47 EDT 1999 Andrew MacLeod <amacleod@cygnus.com>
* lists.c (unused_insn_list, unused_expr_list): New file for
maintaining various types of lists. New statics for maintaining a
cache of available INSN_LIST and EXPR_LIST nodes.
(free_list): Static function for freeing a list of INSN/EXPR nodes.
(alloc_INSN_LIST): Function to get a free INSN_LIST node.
(alloc_EXPR_LIST): Function to get a free EXPR_LIST node.
(init_EXPR_INSN_LIST_cache): Initialize the cache lists.
(free_EXPR_LIST_list): Free an entire list of EXPR_LIST nodes.
(free_INSN_LIST_list): Free an entire list of INSN_LIST nodes.
(free_EXPR_LIST_node): Free an individual EXPR_LIST node.
(free_INSN_LIST_node): Free an individual INSN_LIST node.
* haifa-sched.c (unused_insn_list, unused_expr_list): Moved to flow.c
(free_list, alloc_INSN_LIST, alloc_EXPR_LIST): Moved to flow.c
(remove_dependence, free_pending_lists): Use new global routines.
(flush_pending_lists, sched_analyze_insn): Use new global routines.
(sched_analyze, compute_block_backward_dependences): Use new routines.
(sched_analyze_1, sched_analyze_2): Use new routines.
(schedule_insns): Use new global routines.
* rtl.h (init_EXPR_INSN_LIST_cache, free_EXPR_LIST_list): Add function
prototypes.
(free_INSN_LIST_list, free_EXPR_LIST_node): Add prototypes.
(free_INSN_LIST_node, alloc_INSN_LIST, alloc_EXPR_LIST): Add function
prototypes.
* toplev.c (rest_of_compilation): Initialize node cache.
* Makefile.in (OBJS): Add lists.o to list of object files.
(lists.o): Add dependancies.
From-SVN: r28864
1999-08-25 19:50:53 +02:00
init_EXPR_INSN_LIST_cache ( ) ;
1998-01-17 23:39:10 +01:00
# ifdef SETJMP_VIA_SAVE_AREA
/* This must be performed before virutal register instantiation. */
if ( current_function_calls_alloca )
optimize_save_area_alloca ( insns ) ;
# endif
1992-02-06 00:20:23 +01:00
/* Instantiate all virtual registers. */
instantiate_virtual_regs ( current_function_decl , get_insns ( ) ) ;
/* See if we have allocated stack slots that are not directly addressable.
If so , scan all the insns and create explicit address computation
for all references to such slots . */
1999-09-04 20:25:41 +02:00
/* fixup_stack_slots (); */
1992-02-06 00:20:23 +01:00
1996-07-23 21:58:32 +02:00
/* Find all the EH handlers. */
find_exception_handler_labels ( ) ;
1999-10-27 05:24:38 +02:00
if ( jump_opt_dump )
open_dump_file ( " .01.jump " , decl_printable_name ( decl , 2 ) ) ;
1995-11-27 17:19:26 +01:00
/* Always do one jump optimization pass to ensure that JUMP_LABEL fields
are initialized and to compute whether control can drop off the end
of the function . */
TIMEVAR ( jump_time , reg_scan ( insns , max_reg_num ( ) , 0 ) ) ;
1998-04-27 08:05:55 +02:00
TIMEVAR ( jump_time , jump_optimize ( insns , ! JUMP_CROSS_JUMP , ! JUMP_NOOP_MOVES ,
JUMP_AFTER_REGSCAN ) ) ;
1992-02-06 00:20:23 +01:00
1999-11-04 08:23:58 +01:00
/* Jump optimization, and the removal of NULL pointer checks, may
have reduced the number of instructions substantially . CSE , and
future passes , allocate arrays whose dimensions involve the maximum
instruction UID , so if we can reduce the maximum UID we ' ll save big on
memory . */
renumber_insns ( rtl_dump_file ) ;
/* Dump rtl code after jump, if we are doing that. */
if ( jump_opt_dump )
close_dump_file ( print_rtl , insns ) ;
1992-04-18 00:17:33 +02:00
/* Now is when we stop if -fsyntax-only and -Wreturn-type. */
1995-03-18 12:43:35 +01:00
if ( rtl_dump_and_exit | | flag_syntax_only | | DECL_DEFER_OUTPUT ( decl ) )
1992-04-18 00:17:33 +02:00
goto exit_rest_of_compilation ;
1999-09-20 15:58:33 +02:00
/* Try to identify useless null pointer tests and delete them. */
1999-09-23 21:57:50 +02:00
if ( flag_delete_null_pointer_checks )
1999-09-20 15:58:33 +02:00
TIMEVAR ( jump_time , delete_null_pointer_checks ( get_insns ( ) ) ) ;
1999-09-05 18:08:20 +02:00
if ( ggc_p )
ggc_collect ( ) ;
1992-02-06 00:20:23 +01:00
/* Perform common subexpression elimination.
Nonzero value from ` cse_main ' means that jumps were simplified
and some code may now be unreachable , so do
jump optimization again . */
if ( optimize > 0 )
{
1998-01-26 23:48:32 +01:00
if ( cse_dump )
1999-10-05 06:04:48 +02:00
open_dump_file ( " .02.cse " , decl_printable_name ( decl , 2 ) ) ;
1998-01-26 23:48:32 +01:00
1992-02-06 00:20:23 +01:00
TIMEVAR ( cse_time , reg_scan ( insns , max_reg_num ( ) , 1 ) ) ;
if ( flag_thread_jumps )
1994-01-03 23:20:42 +01:00
TIMEVAR ( jump_time , thread_jumps ( insns , max_reg_num ( ) , 1 ) ) ;
1992-02-06 00:20:23 +01:00
TIMEVAR ( cse_time , tem = cse_main ( insns , max_reg_num ( ) ,
1998-01-26 23:48:32 +01:00
0 , rtl_dump_file ) ) ;
1999-09-07 07:49:18 +02:00
/* If we are not running the second CSE pass, then we are no longer
expecting CSE to be run . */
cse_not_expected = ! flag_rerun_cse_after_loop ;
1994-11-16 13:59:24 +01:00
if ( tem | | optimize > 1 )
1998-04-27 08:05:55 +02:00
TIMEVAR ( jump_time , jump_optimize ( insns , ! JUMP_CROSS_JUMP ,
! JUMP_NOOP_MOVES ,
! JUMP_AFTER_REGSCAN ) ) ;
1999-09-20 15:58:33 +02:00
1999-09-25 21:13:18 +02:00
/* Run this after jump optmizations remove all the unreachable code
so that unreachable code will not keep values live . */
TIMEVAR ( cse_time , delete_trivially_dead_insns ( insns , max_reg_num ( ) ) ) ;
1999-09-20 15:58:33 +02:00
/* Try to identify useless null pointer tests and delete them. */
1999-09-23 21:57:50 +02:00
if ( flag_delete_null_pointer_checks )
1999-09-20 15:58:33 +02:00
TIMEVAR ( jump_time , delete_null_pointer_checks ( get_insns ( ) ) ) ;
1992-02-06 00:20:23 +01:00
1999-11-04 08:23:58 +01:00
/* The second pass of jump optimization is likely to have
removed a bunch more instructions . */
renumber_insns ( rtl_dump_file ) ;
1998-11-23 17:41:12 +01:00
1999-11-04 08:23:58 +01:00
/* Dump rtl code after cse, if we are doing that. */
1998-01-26 23:48:32 +01:00
if ( cse_dump )
1998-11-23 17:41:12 +01:00
{
close_dump_file ( print_rtl , insns ) ;
if ( graph_dump_format ! = no_graph )
1999-10-05 06:04:48 +02:00
print_rtl_graph_with_bb ( dump_base_name , " .02.cse " , insns ) ;
1998-11-23 17:41:12 +01:00
}
1998-01-26 23:48:32 +01:00
}
1992-02-06 00:20:23 +01:00
1997-11-02 22:19:36 +01:00
purge_addressof ( insns ) ;
reg_scan ( insns , max_reg_num ( ) , 1 ) ;
if ( addressof_dump )
1998-11-23 17:41:12 +01:00
{
1999-10-05 06:04:48 +02:00
dump_rtl ( " .03.addressof " , decl , print_rtl , insns ) ;
1998-11-23 17:41:12 +01:00
if ( graph_dump_format ! = no_graph )
1999-10-05 06:04:48 +02:00
print_rtl_graph_with_bb ( dump_base_name , " .03.addressof " , insns ) ;
1998-11-23 17:41:12 +01:00
}
1999-09-05 18:08:20 +02:00
if ( ggc_p )
ggc_collect ( ) ;
1998-05-20 02:24:32 +02:00
/* Perform global cse. */
if ( optimize > 0 & & flag_gcse )
{
if ( gcse_dump )
1999-10-05 06:04:48 +02:00
open_dump_file ( " .04.gcse " , decl_printable_name ( decl , 2 ) ) ;
1998-11-23 17:41:12 +01:00
1999-03-10 20:45:18 +01:00
TIMEVAR ( gcse_time , tem = gcse_main ( insns , rtl_dump_file ) ) ;
/* If gcse altered any jumps, rerun jump optimizations to clean
things up . */
if ( tem )
{
TIMEVAR ( jump_time , jump_optimize ( insns , ! JUMP_CROSS_JUMP ,
! JUMP_NOOP_MOVES ,
! JUMP_AFTER_REGSCAN ) ) ;
}
1998-05-20 02:24:32 +02:00
if ( gcse_dump )
1998-11-23 17:41:12 +01:00
{
close_dump_file ( print_rtl , insns ) ;
if ( graph_dump_format ! = no_graph )
1999-10-05 06:04:48 +02:00
print_rtl_graph_with_bb ( dump_base_name , " .04.gcse " , insns ) ;
1998-11-23 17:41:12 +01:00
}
1999-09-05 18:08:20 +02:00
if ( ggc_p )
ggc_collect ( ) ;
1998-05-20 02:24:32 +02:00
}
1992-02-06 00:20:23 +01:00
/* Move constant computations out of loops. */
if ( optimize > 0 )
{
1998-01-26 23:48:32 +01:00
if ( loop_dump )
1999-10-05 06:04:48 +02:00
open_dump_file ( " .05.loop " , decl_printable_name ( decl , 2 ) ) ;
1998-01-26 23:48:32 +01:00
TIMEVAR
( loop_time ,
{
if ( flag_rerun_loop_opt )
1992-02-06 00:20:23 +01:00
{
1998-01-26 23:48:32 +01:00
/* We only want to perform unrolling once. */
1998-09-18 22:55:00 +02:00
loop_optimize ( insns , rtl_dump_file , 0 , 0 ) ;
1998-01-26 23:48:32 +01:00
1998-04-11 02:28:07 +02:00
/* The first call to loop_optimize makes some instructions
trivially dead . We delete those instructions now in the
hope that doing so will make the heuristics in loop work
better and possibly speed up compilation . */
delete_trivially_dead_insns ( insns , max_reg_num ( ) ) ;
/* The regscan pass is currently necessary as the alias
analysis code depends on this information . */
1998-01-26 23:48:32 +01:00
reg_scan ( insns , max_reg_num ( ) , 1 ) ;
}
1998-09-18 22:55:00 +02:00
loop_optimize ( insns , rtl_dump_file , flag_unroll_loops , 1 ) ;
1998-01-26 23:48:32 +01:00
} ) ;
1998-11-23 17:41:12 +01:00
1998-01-26 23:48:32 +01:00
/* Dump rtl code after loop opt, if we are doing that. */
1998-11-23 17:41:12 +01:00
1998-01-26 23:48:32 +01:00
if ( loop_dump )
1998-11-23 17:41:12 +01:00
{
close_dump_file ( print_rtl , insns ) ;
if ( graph_dump_format ! = no_graph )
1999-10-05 06:04:48 +02:00
print_rtl_graph_with_bb ( dump_base_name , " .05.loop " , insns ) ;
1998-11-23 17:41:12 +01:00
}
1999-09-05 18:08:20 +02:00
if ( ggc_p )
ggc_collect ( ) ;
1992-02-06 00:20:23 +01:00
}
1999-10-04 20:30:10 +02:00
/* ??? Well, nearly. If HAVE_conditional_arithmetic, jump_optimize
has put off all if - conversion until " after CSE " . If we put this
off any longer we may miss out doing if - conversion entirely . */
cse_not_expected = 1 ;
1998-01-26 23:48:32 +01:00
if ( optimize > 0 )
1996-12-07 23:37:32 +01:00
{
1998-01-26 23:48:32 +01:00
if ( cse2_dump )
1999-10-05 06:04:48 +02:00
open_dump_file ( " .06.cse2 " , decl_printable_name ( decl , 2 ) ) ;
1998-11-23 17:41:12 +01:00
1998-01-26 23:48:32 +01:00
if ( flag_rerun_cse_after_loop )
{
/* Running another jump optimization pass before the second
cse pass sometimes simplifies the RTL enough to allow
the second CSE pass to do a better job . Jump_optimize can change
max_reg_num so we must rerun reg_scan afterwards .
? ? ? Rework to not call reg_scan so often . */
TIMEVAR ( jump_time , reg_scan ( insns , max_reg_num ( ) , 0 ) ) ;
1998-04-27 08:05:55 +02:00
TIMEVAR ( jump_time , jump_optimize ( insns , ! JUMP_CROSS_JUMP ,
! JUMP_NOOP_MOVES ,
JUMP_AFTER_REGSCAN ) ) ;
1998-01-26 23:48:32 +01:00
TIMEVAR ( cse2_time , reg_scan ( insns , max_reg_num ( ) , 0 ) ) ;
TIMEVAR ( cse2_time , tem = cse_main ( insns , max_reg_num ( ) ,
1 , rtl_dump_file ) ) ;
if ( tem )
1998-04-27 08:05:55 +02:00
TIMEVAR ( jump_time , jump_optimize ( insns , ! JUMP_CROSS_JUMP ,
! JUMP_NOOP_MOVES ,
! JUMP_AFTER_REGSCAN ) ) ;
1998-01-26 23:48:32 +01:00
}
1997-03-28 23:40:07 +01:00
1998-01-26 23:48:32 +01:00
if ( flag_thread_jumps )
{
/* This pass of jump threading straightens out code
that was kinked by loop optimization . */
TIMEVAR ( jump_time , reg_scan ( insns , max_reg_num ( ) , 0 ) ) ;
TIMEVAR ( jump_time , thread_jumps ( insns , max_reg_num ( ) , 0 ) ) ;
}
1998-11-23 17:41:12 +01:00
1998-01-26 23:48:32 +01:00
/* Dump rtl code after cse, if we are doing that. */
if ( cse2_dump )
1998-11-23 17:41:12 +01:00
{
close_dump_file ( print_rtl , insns ) ;
if ( graph_dump_format ! = no_graph )
1999-10-05 06:04:48 +02:00
print_rtl_graph_with_bb ( dump_base_name , " .06.cse2 " , insns ) ;
1998-11-23 17:41:12 +01:00
}
1999-09-05 18:08:20 +02:00
if ( ggc_p )
ggc_collect ( ) ;
1998-01-26 23:48:32 +01:00
}
1998-11-23 17:41:12 +01:00
1997-03-28 23:40:07 +01:00
if ( profile_arc_flag | | flag_test_coverage | | flag_branch_probabilities )
1998-01-26 23:48:32 +01:00
{
if ( branch_prob_dump )
1999-10-05 06:04:48 +02:00
open_dump_file ( " .07.bp " , decl_printable_name ( decl , 2 ) ) ;
1998-11-23 17:41:12 +01:00
1998-01-26 23:48:32 +01:00
TIMEVAR
( branch_prob_time ,
{
branch_prob ( insns , rtl_dump_file ) ;
} ) ;
1998-11-23 17:41:12 +01:00
1998-01-26 23:48:32 +01:00
if ( branch_prob_dump )
1998-11-23 17:41:12 +01:00
{
close_dump_file ( print_rtl , insns ) ;
if ( graph_dump_format ! = no_graph )
1999-10-05 06:04:48 +02:00
print_rtl_graph_with_bb ( dump_base_name , " .07.bp " , insns ) ;
1998-11-23 17:41:12 +01:00
}
1999-09-05 18:08:20 +02:00
if ( ggc_p )
ggc_collect ( ) ;
1998-01-26 23:48:32 +01:00
}
1998-11-23 17:41:12 +01:00
1992-02-06 00:20:23 +01:00
/* Now we choose between stupid (pcc-like) register allocation
( if we got the - noreg switch and not - opt )
and smart register allocation . */
1999-04-07 06:42:42 +02:00
if ( optimize > 0 ) /* Stupid allocation probably won't work */
1992-02-06 00:20:23 +01:00
obey_regdecls = 0 ; /* if optimizations being done. */
regclass_init ( ) ;
/* Print function header into flow dump now
because doing the flow analysis makes some of the dump . */
if ( flow_dump )
1999-10-05 06:04:48 +02:00
open_dump_file ( " .08.flow " , decl_printable_name ( decl , 2 ) ) ;
1998-01-26 23:48:32 +01:00
1992-02-06 00:20:23 +01:00
if ( obey_regdecls )
{
TIMEVAR ( flow_time ,
{
1999-11-21 13:33:17 +01:00
regclass ( insns , max_reg_num ( ) , NULL ) ;
1992-02-06 00:20:23 +01:00
stupid_life_analysis ( insns , max_reg_num ( ) ,
1998-01-26 23:48:32 +01:00
rtl_dump_file ) ;
1992-02-06 00:20:23 +01:00
} ) ;
}
else
{
/* Do control and data flow analysis,
and write some of the results to dump file . */
1998-03-05 23:31:51 +01:00
TIMEVAR
( flow_time ,
{
1999-03-31 14:41:03 +02:00
find_basic_blocks ( insns , max_reg_num ( ) , rtl_dump_file , 1 ) ;
1999-12-18 19:30:41 +01:00
calculate_loop_depth ( rtl_dump_file ) ;
1999-04-11 00:53:08 +02:00
life_analysis ( insns , max_reg_num ( ) , rtl_dump_file , 1 ) ;
1998-03-05 23:31:51 +01:00
} ) ;
1999-10-31 22:52:00 +01:00
if ( warn_uninitialized | | extra_warnings )
1992-02-06 00:20:23 +01:00
{
uninitialized_vars_warning ( DECL_INITIAL ( decl ) ) ;
1999-10-31 22:52:00 +01:00
if ( extra_warnings )
setjmp_args_warning ( ) ;
1992-02-06 00:20:23 +01:00
}
}
/* Dump rtl after flow analysis. */
if ( flow_dump )
1998-11-23 17:41:12 +01:00
{
close_dump_file ( print_rtl_with_bb , insns ) ;
if ( graph_dump_format ! = no_graph )
1999-10-05 06:04:48 +02:00
print_rtl_graph_with_bb ( dump_base_name , " .08.flow " , insns ) ;
1998-11-23 17:41:12 +01:00
}
1999-09-05 18:08:20 +02:00
if ( ggc_p )
ggc_collect ( ) ;
1998-11-25 11:31:24 +01:00
/* The first life analysis pass has finished. From now on we can not
generate any new pseudos . */
no_new_pseudos = 1 ;
1992-02-06 00:20:23 +01:00
/* If -opt, try combining insns through substitution. */
if ( optimize > 0 )
1998-01-26 23:48:32 +01:00
{
TIMEVAR ( combine_time , combine_instructions ( insns , max_reg_num ( ) ) ) ;
1998-11-23 17:41:12 +01:00
1998-01-26 23:48:32 +01:00
/* Dump rtl code after insn combination. */
1998-11-23 17:41:12 +01:00
1998-01-26 23:48:32 +01:00
if ( combine_dump )
1998-11-23 17:41:12 +01:00
{
1999-10-05 06:04:48 +02:00
dump_rtl ( " .09.combine " , decl , print_rtl_with_bb , insns ) ;
1998-11-23 17:41:12 +01:00
if ( graph_dump_format ! = no_graph )
1999-10-05 06:04:48 +02:00
print_rtl_graph_with_bb ( dump_base_name , " .09.combine " , insns ) ;
1998-11-23 17:41:12 +01:00
}
1999-09-05 18:08:20 +02:00
if ( ggc_p )
ggc_collect ( ) ;
1998-01-26 23:48:32 +01:00
}
1997-08-12 06:07:19 +02:00
/* Register allocation pre-pass, to reduce number of moves
necessary for two - address machines . */
1998-02-05 17:34:02 +01:00
if ( optimize > 0 & & ( flag_regmove | | flag_expensive_optimizations ) )
1998-01-26 23:48:32 +01:00
{
if ( regmove_dump )
1999-10-05 06:04:48 +02:00
open_dump_file ( " .10.regmove " , decl_printable_name ( decl , 2 ) ) ;
1998-11-23 17:41:12 +01:00
1998-01-26 23:48:32 +01:00
TIMEVAR ( regmove_time , regmove_optimize ( insns , max_reg_num ( ) ,
rtl_dump_file ) ) ;
1998-11-23 17:41:12 +01:00
1998-01-26 23:48:32 +01:00
if ( regmove_dump )
1998-11-23 17:41:12 +01:00
{
close_dump_file ( print_rtl_with_bb , insns ) ;
if ( graph_dump_format ! = no_graph )
1999-10-05 06:04:48 +02:00
print_rtl_graph_with_bb ( dump_base_name , " .10.regmove " , insns ) ;
1998-11-23 17:41:12 +01:00
}
1999-09-05 18:08:20 +02:00
if ( ggc_p )
ggc_collect ( ) ;
1998-01-26 23:48:32 +01:00
}
1997-08-12 06:07:19 +02:00
1992-02-06 00:20:23 +01:00
/* Print function header into sched dump now
because doing the sched analysis makes some of the dump . */
1999-10-05 06:04:48 +02:00
# ifdef INSN_SCHEDULING
1992-02-06 00:20:23 +01:00
if ( optimize > 0 & & flag_schedule_insns )
{
1998-01-26 23:48:32 +01:00
if ( sched_dump )
1999-10-05 06:04:48 +02:00
open_dump_file ( " .11.sched " , decl_printable_name ( decl , 2 ) ) ;
1998-11-23 17:41:12 +01:00
1992-02-06 00:20:23 +01:00
/* Do control and data sched analysis,
and write some of the results to dump file . */
1998-01-26 23:48:32 +01:00
TIMEVAR ( sched_time , schedule_insns ( rtl_dump_file ) ) ;
1998-11-23 17:41:12 +01:00
1998-01-26 23:48:32 +01:00
/* Dump rtl after instruction scheduling. */
1998-11-23 17:41:12 +01:00
1998-01-26 23:48:32 +01:00
if ( sched_dump )
1998-11-23 17:41:12 +01:00
{
close_dump_file ( print_rtl_with_bb , insns ) ;
if ( graph_dump_format ! = no_graph )
1999-10-05 06:04:48 +02:00
print_rtl_graph_with_bb ( dump_base_name , " .11.sched " , insns ) ;
1998-11-23 17:41:12 +01:00
}
1999-09-05 18:08:20 +02:00
if ( ggc_p )
ggc_collect ( ) ;
1992-02-06 00:20:23 +01:00
}
1999-10-05 06:04:48 +02:00
# endif
1992-02-06 00:20:23 +01:00
1999-04-18 15:09:37 +02:00
/* Determine if the current function is a leaf before running reload
since this can impact optimizations done by the prologue and
epilogue thus changing register elimination offsets . */
current_function_is_leaf = leaf_function_p ( ) ;
1999-11-21 13:33:17 +01:00
if ( local_reg_dump )
open_dump_file ( " .12.lreg " , decl_printable_name ( decl , 2 ) ) ;
1992-02-06 00:20:23 +01:00
/* Unless we did stupid register allocation,
1999-04-10 04:55:36 +02:00
allocate pseudo - regs that are used only within 1 basic block .
RUN_JUMP_AFTER_RELOAD records whether or not we need to rerun the
jump optimizer after register allocation and reloading are finished . */
1992-02-06 00:20:23 +01:00
if ( ! obey_regdecls )
TIMEVAR ( local_alloc_time ,
{
1999-10-20 16:04:12 +02:00
/* We recomputed reg usage as part of updating the rest
of life info during sched . */
if ( ! flag_schedule_insns )
recompute_reg_usage ( insns , ! optimize_size ) ;
1999-11-21 13:33:17 +01:00
regclass ( insns , max_reg_num ( ) , rtl_dump_file ) ;
1999-04-10 06:17:51 +02:00
rebuild_label_notes_after_reload = local_alloc ( ) ;
1992-02-06 00:20:23 +01:00
} ) ;
1999-04-10 04:55:36 +02:00
else
1999-04-10 06:17:51 +02:00
rebuild_label_notes_after_reload = 0 ;
1992-02-06 00:20:23 +01:00
/* Dump rtl code after allocating regs within basic blocks. */
if ( local_reg_dump )
1998-01-26 23:48:32 +01:00
{
TIMEVAR ( dump_time , dump_flow_info ( rtl_dump_file ) ) ;
TIMEVAR ( dump_time , dump_local_alloc ( rtl_dump_file ) ) ;
1998-11-23 17:41:12 +01:00
1998-01-26 23:48:32 +01:00
close_dump_file ( print_rtl_with_bb , insns ) ;
1998-11-23 17:41:12 +01:00
if ( graph_dump_format ! = no_graph )
1999-10-05 06:04:48 +02:00
print_rtl_graph_with_bb ( dump_base_name , " .12.lreg " , insns ) ;
1998-01-26 23:48:32 +01:00
}
1992-02-06 00:20:23 +01:00
1999-09-05 18:08:20 +02:00
if ( ggc_p )
ggc_collect ( ) ;
1992-02-06 00:20:23 +01:00
if ( global_reg_dump )
1999-10-05 06:04:48 +02:00
open_dump_file ( " .13.greg " , decl_printable_name ( decl , 2 ) ) ;
1992-02-06 00:20:23 +01:00
/* Unless we did stupid register allocation,
allocate remaining pseudo - regs , then do the reload pass
fixing up any insns that are invalid . */
TIMEVAR ( global_alloc_time ,
{
if ( ! obey_regdecls )
1998-01-26 23:48:32 +01:00
failure = global_alloc ( rtl_dump_file ) ;
1992-02-06 00:20:23 +01:00
else
1998-01-26 23:48:32 +01:00
failure = reload ( insns , 0 , rtl_dump_file ) ;
1992-02-06 00:20:23 +01:00
} ) ;
1992-06-22 04:02:28 +02:00
if ( failure )
goto exit_rest_of_compilation ;
1999-09-05 18:08:20 +02:00
if ( ggc_p )
ggc_collect ( ) ;
1997-07-18 14:12:15 +02:00
/* Do a very simple CSE pass over just the hard registers. */
if ( optimize > 0 )
reload_cse_regs ( insns ) ;
1999-04-10 06:17:51 +02:00
/* Register allocation and reloading may have turned an indirect jump into
a direct jump . If so , we must rebuild the JUMP_LABEL fields of
jumping instructions . */
if ( rebuild_label_notes_after_reload )
TIMEVAR ( jump_time , rebuild_jump_labels ( insns ) ) ;
Makefile.in (flow.o): Depend on TREE_H.
* Makefile.in (flow.o): Depend on TREE_H.
* basic-block.h (REG_SET_EQUAL_P): New.
(XOR_REG_SET): New.
(n_edges): Declare.
(free_regset_vector): Remove declaration.
(flow_delete_insn_chain): Declare.
(enum update_life_extent): New.
(update_life_info, count_or_remove_death_notes): Declare.
* combine.c (distribute_notes) [REG_DEAD]: Stop search at bb->head.
Verify register live at bb->global_live_at_start before adding USE.
* flow.c (HAVE_epilogue, HAVE_prologue): Provide default.
(CLEAN_ALLOCA): New.
(n_edges): New.
(PROP_*): New flags.
(find_basic_blocks_1): Use alloc_EXPR_LIST.
(clear_edges): Zero n_edges.
(make_edge): Increment n_edges.
(split_edge): Don't allocate bb->local_set. Increment n_edges.
(flow_delete_insn_chain): Export.
(delete_block): Decrement n_edges.
(merge_blocks_nomove): Likewise.
(life_analysis): Give life_analysis_1 PROP flags.
(verify_wide_reg_1, verify_wide_reg): New.
(verify_local_live_at_start): New.
(update_life_info): Rewrite to call into propogate_block.
(mark_reg): New.
(mark_regs_live_at_end): After reload, if epilogue as rtl,
always mark stack pointer. Conditionally mark PIC register.
After reload, mark call-saved registers, return regsiters.
(life_analysis_1): Accept PROP flags not remove_dead_code.
Call mark_regs_live_at_end before zeroing regs_ever_live.
Use calculate_global_regs_live. Copy global_live_at_end before
calling final propagate_block. Zero reg_next_use on exit.
(calculate_global_regs_live): New.
(allocate_bb_life_data): Don't allocate bb->local_set.
(init_regset_vector, free_regset_vector): Remove.
(propagate_block): Accept FLAGS not FINAL or REMOVE_DEAD_CODE.
Test flags before every operation. Warn if prologue/epilogue insn
would have been deleted.
(mark_set_regs, mark_set_1): Accept and use FLAGS.
Use alloc_EXPR_LIST.
(mark_used_regs): Accept and use FLAGS, not FINAL.
Remove special handling for RETURN.
(try_pre_increment): Use alloc_EXPR_LIST.
(dump_flow_info): Dump n_edges.
(unlink_insn_chain, split_hard_reg_notes): Remove.
(maybe_add_dead_note, maybe_add_dead_note_use): Remove.
(find_insn_with_note, new_insn_dead_notes): Remove.
(update_n_sets, sets_reg_or_subreg_1, sets_reg_or_subreg): Remove.
(maybe_remove_dead_notes, prepend_reg_notes): Remove.
(replace_insns): Remove.
(count_or_remove_death_notes): New.
(verify_flow_info): Abort on error after all checks.
(remove_edge): Decrement n_edges.
(remove_fake_edges): Tweek format.
* haifa-sched.c (schedule_insns): Use split_all_insns.
* output.h (update_life_info): Remove declaration.
* recog.c (split_all_insns): From the corpse of split_block_insns,
do the whole function block by block. Use update_life_info.
(recog_last_allowed_insn): New.
(recog_next_insn): Mind it.
(peephole2_optimize): Set it. Walk backwards through blocks.
Use update_life_info.
* rtl.h (update_flow_info, replace_insns): Remove declarations.
(split_all_insns): Declare.
* toplev.c (rest_of_compilation): Thread prologue before flow2.
Use split_all_insns.
* i386.md (or -1 peep2s): Disable.
From-SVN: r29877
1999-10-09 21:47:18 +02:00
/* On some machines, the prologue and epilogue code, or parts thereof,
can be represented as RTL . Doing so lets us schedule insns between
it and the rest of the code and also allows delayed branch
scheduling to operate in the epilogue . */
thread_prologue_and_epilogue_insns ( insns ) ;
1998-12-01 15:36:51 +01:00
/* If optimizing and we are performing instruction scheduling after
reload , then go ahead and split insns now since we are about to
recompute flow information anyway .
reload_cse_regs may expose more splitting opportunities , expecially
for double - word operations . */
if ( optimize > 0 & & flag_schedule_insns_after_reload )
Makefile.in (flow.o): Depend on TREE_H.
* Makefile.in (flow.o): Depend on TREE_H.
* basic-block.h (REG_SET_EQUAL_P): New.
(XOR_REG_SET): New.
(n_edges): Declare.
(free_regset_vector): Remove declaration.
(flow_delete_insn_chain): Declare.
(enum update_life_extent): New.
(update_life_info, count_or_remove_death_notes): Declare.
* combine.c (distribute_notes) [REG_DEAD]: Stop search at bb->head.
Verify register live at bb->global_live_at_start before adding USE.
* flow.c (HAVE_epilogue, HAVE_prologue): Provide default.
(CLEAN_ALLOCA): New.
(n_edges): New.
(PROP_*): New flags.
(find_basic_blocks_1): Use alloc_EXPR_LIST.
(clear_edges): Zero n_edges.
(make_edge): Increment n_edges.
(split_edge): Don't allocate bb->local_set. Increment n_edges.
(flow_delete_insn_chain): Export.
(delete_block): Decrement n_edges.
(merge_blocks_nomove): Likewise.
(life_analysis): Give life_analysis_1 PROP flags.
(verify_wide_reg_1, verify_wide_reg): New.
(verify_local_live_at_start): New.
(update_life_info): Rewrite to call into propogate_block.
(mark_reg): New.
(mark_regs_live_at_end): After reload, if epilogue as rtl,
always mark stack pointer. Conditionally mark PIC register.
After reload, mark call-saved registers, return regsiters.
(life_analysis_1): Accept PROP flags not remove_dead_code.
Call mark_regs_live_at_end before zeroing regs_ever_live.
Use calculate_global_regs_live. Copy global_live_at_end before
calling final propagate_block. Zero reg_next_use on exit.
(calculate_global_regs_live): New.
(allocate_bb_life_data): Don't allocate bb->local_set.
(init_regset_vector, free_regset_vector): Remove.
(propagate_block): Accept FLAGS not FINAL or REMOVE_DEAD_CODE.
Test flags before every operation. Warn if prologue/epilogue insn
would have been deleted.
(mark_set_regs, mark_set_1): Accept and use FLAGS.
Use alloc_EXPR_LIST.
(mark_used_regs): Accept and use FLAGS, not FINAL.
Remove special handling for RETURN.
(try_pre_increment): Use alloc_EXPR_LIST.
(dump_flow_info): Dump n_edges.
(unlink_insn_chain, split_hard_reg_notes): Remove.
(maybe_add_dead_note, maybe_add_dead_note_use): Remove.
(find_insn_with_note, new_insn_dead_notes): Remove.
(update_n_sets, sets_reg_or_subreg_1, sets_reg_or_subreg): Remove.
(maybe_remove_dead_notes, prepend_reg_notes): Remove.
(replace_insns): Remove.
(count_or_remove_death_notes): New.
(verify_flow_info): Abort on error after all checks.
(remove_edge): Decrement n_edges.
(remove_fake_edges): Tweek format.
* haifa-sched.c (schedule_insns): Use split_all_insns.
* output.h (update_life_info): Remove declaration.
* recog.c (split_all_insns): From the corpse of split_block_insns,
do the whole function block by block. Use update_life_info.
(recog_last_allowed_insn): New.
(recog_next_insn): Mind it.
(peephole2_optimize): Set it. Walk backwards through blocks.
Use update_life_info.
* rtl.h (update_flow_info, replace_insns): Remove declarations.
(split_all_insns): Declare.
* toplev.c (rest_of_compilation): Thread prologue before flow2.
Use split_all_insns.
* i386.md (or -1 peep2s): Disable.
From-SVN: r29877
1999-10-09 21:47:18 +02:00
split_all_insns ( 0 ) ;
1998-12-01 15:36:51 +01:00
1999-02-26 00:45:42 +01:00
if ( global_reg_dump )
{
TIMEVAR ( dump_time , dump_global_regs ( rtl_dump_file ) ) ;
close_dump_file ( print_rtl_with_bb , insns ) ;
if ( graph_dump_format ! = no_graph )
1999-10-05 06:04:48 +02:00
print_rtl_graph_with_bb ( dump_base_name , " .13.greg " , insns ) ;
1999-02-26 00:45:42 +01:00
}
1998-10-16 02:08:51 +02:00
/* Re-create the death notes which were deleted during reload. */
1999-02-26 00:45:42 +01:00
if ( flow2_dump )
1999-10-05 06:04:48 +02:00
open_dump_file ( " .14.flow2 " , decl_printable_name ( decl , 2 ) ) ;
1999-02-26 00:45:42 +01:00
1998-10-16 02:08:51 +02:00
if ( optimize )
1999-02-26 00:45:42 +01:00
{
TIMEVAR
( flow2_time ,
{
1999-03-31 14:41:03 +02:00
find_basic_blocks ( insns , max_reg_num ( ) , rtl_dump_file , 1 ) ;
1999-04-11 00:53:08 +02:00
life_analysis ( insns , max_reg_num ( ) , rtl_dump_file , 1 ) ;
1999-02-26 00:45:42 +01:00
} ) ;
1999-09-05 18:08:20 +02:00
if ( ggc_p )
ggc_collect ( ) ;
1999-02-26 00:45:42 +01:00
}
1998-10-16 02:08:51 +02:00
1998-11-04 21:45:03 +01:00
flow2_completed = 1 ;
1999-02-26 00:45:42 +01:00
if ( flow2_dump )
1998-06-29 23:40:49 +02:00
{
close_dump_file ( print_rtl_with_bb , insns ) ;
1998-11-23 17:41:12 +01:00
if ( graph_dump_format ! = no_graph )
1999-10-05 06:04:48 +02:00
print_rtl_graph_with_bb ( dump_base_name , " .14.flow2 " , insns ) ;
1998-06-29 23:40:49 +02:00
}
1999-02-26 00:45:42 +01:00
1999-08-31 22:37:09 +02:00
# ifdef HAVE_peephole2
if ( optimize > 0 & & flag_peephole2 )
{
if ( peephole2_dump )
1999-10-05 06:04:48 +02:00
open_dump_file ( " .15.peephole2 " , decl_printable_name ( decl , 2 ) ) ;
1999-08-31 22:37:09 +02:00
1999-10-05 06:04:48 +02:00
TIMEVAR ( peephole2_time , peephole2_optimize ( rtl_dump_file ) ) ;
1999-08-31 22:37:09 +02:00
if ( peephole2_dump )
{
close_dump_file ( print_rtl_with_bb , insns ) ;
if ( graph_dump_format ! = no_graph )
1999-10-05 06:04:48 +02:00
print_rtl_graph_with_bb ( dump_base_name , " .15.peephole2 " , insns ) ;
1999-08-31 22:37:09 +02:00
}
}
# endif
1999-10-05 06:04:48 +02:00
# ifdef INSN_SCHEDULING
1992-02-06 00:20:23 +01:00
if ( optimize > 0 & & flag_schedule_insns_after_reload )
{
if ( sched2_dump )
1999-10-05 06:04:48 +02:00
open_dump_file ( " .16.sched2 " , decl_printable_name ( decl , 2 ) ) ;
1992-02-06 00:20:23 +01:00
/* Do control and data sched analysis again,
and write some more of the results to dump file . */
1998-01-26 23:48:32 +01:00
TIMEVAR ( sched2_time , schedule_insns ( rtl_dump_file ) ) ;
1992-02-06 00:20:23 +01:00
/* Dump rtl after post-reorder instruction scheduling. */
if ( sched2_dump )
1998-11-23 17:41:12 +01:00
{
close_dump_file ( print_rtl_with_bb , insns ) ;
if ( graph_dump_format ! = no_graph )
1999-10-05 06:04:48 +02:00
print_rtl_graph_with_bb ( dump_base_name , " .16.sched2 " , insns ) ;
1998-11-23 17:41:12 +01:00
}
1999-09-05 18:08:20 +02:00
if ( ggc_p )
ggc_collect ( ) ;
1992-02-06 00:20:23 +01:00
}
1999-10-05 06:04:48 +02:00
# endif
1992-02-06 00:20:23 +01:00
# ifdef LEAF_REGISTERS
1999-04-22 21:25:05 +02:00
current_function_uses_only_leaf_regs
= optimize > 0 & & only_leaf_regs_used ( ) & & leaf_function_p ( ) ;
1992-02-06 00:20:23 +01:00
# endif
/* One more attempt to remove jumps to .+1
left by dead - store - elimination .
Also do cross - jumping this time
and delete no - op move insns . */
if ( optimize > 0 )
{
1998-04-27 08:05:55 +02:00
TIMEVAR ( jump_time , jump_optimize ( insns , JUMP_CROSS_JUMP ,
JUMP_NOOP_MOVES ,
! JUMP_AFTER_REGSCAN ) ) ;
1998-11-23 17:41:12 +01:00
1998-01-26 23:48:32 +01:00
/* Dump rtl code after jump, if we are doing that. */
1992-02-06 00:20:23 +01:00
1998-01-26 23:48:32 +01:00
if ( jump2_opt_dump )
1998-11-23 17:41:12 +01:00
{
1999-10-05 06:04:48 +02:00
dump_rtl ( " .17.jump2 " , decl , print_rtl_with_bb , insns ) ;
1998-11-23 17:41:12 +01:00
if ( graph_dump_format ! = no_graph )
1999-10-05 06:04:48 +02:00
print_rtl_graph_with_bb ( dump_base_name , " .17.jump2 " , insns ) ;
1998-11-23 17:41:12 +01:00
}
1998-01-26 23:48:32 +01:00
}
1992-02-06 00:20:23 +01:00
1994-02-05 14:24:30 +01:00
/* If a machine dependent reorganization is needed, call it. */
# ifdef MACHINE_DEPENDENT_REORG
1999-08-16 12:06:19 +02:00
if ( mach_dep_reorg_dump )
1999-10-05 06:04:48 +02:00
open_dump_file ( " .18.mach " , decl_printable_name ( decl , 2 ) ) ;
1999-08-16 12:06:19 +02:00
1994-02-05 14:24:30 +01:00
MACHINE_DEPENDENT_REORG ( insns ) ;
1998-01-26 23:48:32 +01:00
if ( mach_dep_reorg_dump )
1998-11-23 17:41:12 +01:00
{
1999-08-16 12:06:19 +02:00
close_dump_file ( print_rtl_with_bb , insns ) ;
1998-11-23 17:41:12 +01:00
if ( graph_dump_format ! = no_graph )
1999-10-05 06:04:48 +02:00
print_rtl_graph_with_bb ( dump_base_name , " .18.mach " , insns ) ;
1998-11-23 17:41:12 +01:00
}
1999-09-05 18:08:20 +02:00
if ( ggc_p )
ggc_collect ( ) ;
1994-02-05 14:24:30 +01:00
# endif
1992-02-06 00:20:23 +01:00
/* If a scheduling pass for delayed branches is to be done,
1996-07-04 00:07:53 +02:00
call the scheduling code . */
1992-02-06 00:20:23 +01:00
# ifdef DELAY_SLOTS
if ( optimize > 0 & & flag_delayed_branch )
{
1999-03-31 18:26:36 +02:00
if ( dbr_sched_dump )
1999-10-05 06:04:48 +02:00
open_dump_file ( " .19.dbr " , decl_printable_name ( decl , 2 ) ) ;
1999-03-31 18:26:36 +02:00
1999-10-29 23:45:05 +02:00
TIMEVAR
( dbr_sched_time ,
{
dbr_schedule ( insns , rtl_dump_file ) ;
} ) ;
1998-11-23 17:41:12 +01:00
1992-02-06 00:20:23 +01:00
if ( dbr_sched_dump )
1998-11-23 17:41:12 +01:00
{
1999-03-31 18:26:36 +02:00
close_dump_file ( print_rtl_with_bb , insns ) ;
1998-11-23 17:41:12 +01:00
if ( graph_dump_format ! = no_graph )
1999-10-05 06:04:48 +02:00
print_rtl_graph_with_bb ( dump_base_name , " .19.dbr " , insns ) ;
1998-11-23 17:41:12 +01:00
}
1992-02-06 00:20:23 +01:00
}
1999-09-05 18:08:20 +02:00
if ( ggc_p )
ggc_collect ( ) ;
1992-02-06 00:20:23 +01:00
# endif
2000-01-05 06:32:27 +01:00
/* Shorten branches.
Note this must run before reg - stack because of death note ( ab ) use
in the ia32 backend . */
TIMEVAR ( shorten_branch_time ,
{
shorten_branches ( get_insns ( ) ) ;
} ) ;
1992-02-06 00:20:23 +01:00
# ifdef STACK_REGS
1998-09-10 02:40:19 +02:00
if ( stack_reg_dump )
1999-10-05 06:04:48 +02:00
open_dump_file ( " .20.stack " , decl_printable_name ( decl , 2 ) ) ;
1998-09-10 02:40:19 +02:00
1998-01-27 11:02:22 +01:00
TIMEVAR ( stack_reg_time , reg_to_stack ( insns , rtl_dump_file ) ) ;
1998-01-26 23:48:32 +01:00
1992-02-06 00:20:23 +01:00
if ( stack_reg_dump )
1998-11-23 17:41:12 +01:00
{
1999-10-05 06:04:48 +02:00
close_dump_file ( print_rtl_with_bb , insns ) ;
1998-11-23 17:41:12 +01:00
if ( graph_dump_format ! = no_graph )
1999-10-05 06:04:48 +02:00
print_rtl_graph_with_bb ( dump_base_name , " .20.stack " , insns ) ;
1998-11-23 17:41:12 +01:00
}
1999-09-05 18:08:20 +02:00
if ( ggc_p )
ggc_collect ( ) ;
1992-02-06 00:20:23 +01:00
# endif
/* Now turn the rtl into assembler code. */
TIMEVAR ( final_time ,
{
rtx x ;
char * fnname ;
/* Get the function's name, as described by its RTL.
This may be different from the DECL_NAME name used
in the source file . */
x = DECL_RTL ( decl ) ;
if ( GET_CODE ( x ) ! = MEM )
abort ( ) ;
x = XEXP ( x , 0 ) ;
if ( GET_CODE ( x ) ! = SYMBOL_REF )
abort ( ) ;
fnname = XSTR ( x , 0 ) ;
assemble_start_function ( decl , fnname ) ;
final_start_function ( insns , asm_out_file , optimize ) ;
final ( insns , asm_out_file , optimize , 0 ) ;
final_end_function ( insns , asm_out_file , optimize ) ;
assemble_end_function ( decl , fnname ) ;
1998-04-04 15:32:39 +02:00
if ( ! quiet_flag )
fflush ( asm_out_file ) ;
1997-07-14 12:51:35 +02:00
1999-02-26 00:45:42 +01:00
/* Release all memory allocated by flow. */
free_basic_block_vars ( 0 ) ;
1997-07-14 12:51:35 +02:00
/* Release all memory held by regsets now */
regset_release_memory ( ) ;
1992-02-06 00:20:23 +01:00
} ) ;
1999-09-05 18:08:20 +02:00
if ( ggc_p )
ggc_collect ( ) ;
1992-02-06 00:20:23 +01:00
/* Write DBX symbols if requested */
/* Note that for those inline functions where we don't initially
know for certain that we will be generating an out - of - line copy ,
the first invocation of this routine ( rest_of_compilation ) will
skip over this code by doing a ` goto exit_rest_of_compilation ; ' .
Later on , finish_compilation will call rest_of_compilation again
for those inline functions that need to have out - of - line copies
generated . During that call , we * will * be routed past here . */
# ifdef DBX_DEBUGGING_INFO
if ( write_symbols = = DBX_DEBUG )
TIMEVAR ( symout_time , dbxout_function ( decl ) ) ;
# endif
# ifdef DWARF_DEBUGGING_INFO
if ( write_symbols = = DWARF_DEBUG )
TIMEVAR ( symout_time , dwarfout_file_scope_decl ( decl , 0 ) ) ;
# endif
1996-11-15 08:14:08 +01:00
# ifdef DWARF2_DEBUGGING_INFO
if ( write_symbols = = DWARF2_DEBUG )
1996-11-20 21:36:53 +01:00
TIMEVAR ( symout_time , dwarf2out_decl ( decl ) ) ;
1996-11-15 08:14:08 +01:00
# endif
1992-02-06 00:20:23 +01:00
exit_rest_of_compilation :
1992-03-23 20:29:32 +01:00
/* In case the function was not output,
don ' t leave any temporary anonymous types
queued up for sdb output . */
# ifdef SDB_DEBUGGING_INFO
if ( write_symbols = = SDB_DEBUG )
1992-07-06 22:14:57 +02:00
sdbout_types ( NULL_TREE ) ;
1992-03-23 20:29:32 +01:00
# endif
1992-02-06 00:20:23 +01:00
reload_completed = 0 ;
1998-11-04 21:45:03 +01:00
flow2_completed = 0 ;
1998-11-25 11:31:24 +01:00
no_new_pseudos = 0 ;
1992-02-06 00:20:23 +01:00
1998-05-13 14:26:49 +02:00
TIMEVAR ( final_time ,
{
/* Clear out the insn_length contents now that they are no
longer valid . */
init_insn_lengths ( ) ;
1992-02-06 00:20:23 +01:00
1998-05-13 14:26:49 +02:00
/* Clear out the real_constant_chain before some of the rtx's
it runs through become garbage . */
clear_const_double_mem ( ) ;
1992-02-06 00:20:23 +01:00
1998-05-13 14:26:49 +02:00
/* Cancel the effect of rtl_in_current_obstack. */
resume_temporary_allocation ( ) ;
1995-12-15 14:09:51 +01:00
1998-05-13 14:26:49 +02:00
/* Show no temporary slots allocated. */
init_temp_slots ( ) ;
1999-09-16 03:12:25 +02:00
free_basic_block_vars ( 0 ) ;
1998-05-13 14:26:49 +02:00
} ) ;
1995-12-15 14:09:51 +01:00
1998-03-31 18:59:41 +02:00
/* Make sure volatile mem refs aren't considered valid operands for
arithmetic insns . We must call this here if this is a nested inline
function , since the above code leaves us in the init_recog state
( from final . c ) , and the function context push / pop code does not
save / restore volatile_ok .
? ? ? Maybe it isn ' t necessary for expand_start_function to call this
anymore if we do it here ? */
init_recog_no_volatile ( ) ;
1999-09-07 17:20:58 +02:00
/* We're done with this function. Free up memory if we can. */
1999-12-20 14:18:17 +01:00
free_after_parsing ( cfun ) ;
1999-09-16 03:12:25 +02:00
if ( ! DECL_DEFER_OUTPUT ( decl ) )
1999-12-20 14:18:17 +01:00
free_after_compilation ( cfun ) ;
cfun = 0 ;
1999-09-05 18:08:20 +02:00
1999-09-07 17:20:58 +02:00
if ( ggc_p )
ggc_collect ( ) ;
1999-09-05 18:08:20 +02:00
1992-02-06 00:20:23 +01:00
/* The parsing time is all the time spent in yyparse
* except * what is spent in this function . */
parse_time - = get_run_time ( ) - start_time ;
}
1998-07-13 19:20:29 +02:00
static void
display_help ( )
{
int undoc ;
Makefile.in (toplev.o): Depend on $(EXPR_H).
* Makefile.in (toplev.o): Depend on $(EXPR_H).
(insn-extract.o, insn-attrtab.o): Depend on toplev.h.
* gansidecl.h: Define ATTRIBUTE_NORETURN.
* genattrtab.c: Have insn-attrtab.c include toplev.h.
* genextract.c: Have insn-extract.c include toplev.h.
* rtl.h: Don't prototype `fatal_insn_not_found' and `fatal_insn'.
* toplev.c: Include expr.h.
(really_sorry, fancy_abort): Remove prototypes.
(set_target_switch): Add argument in prototype.
(vfatal): Mark prototype with ATTRIBUTE_NORETURN.
(v_really_sorry): Likewise.
(print_version, print_single_switch, print_switch_values): Make
static and add prototype arguments.
(decl_printable_name): Add prototype arguments.
(lang_expand_expr_t): New typedef.
(lang_expand_expr): Declare as a lang_expand_expr_t.
(incomplete_decl_finalize_hook): Add prototype argument.
(decl_name): Mark variable `verbosity' with ATTRIBUTE_UNUSED.
(botch): Likewise for variable `s'.
(rest_of_type_compilation): Mark variables `type' and `toplev'
with ATTRIBUTE_UNUSED if none of DBX_DEBUGGING_INFO,
XCOFF_DEBUGGING_INFO or SDB_DEBUGGING_INFO are defined.
(display_help): Make variable `i' an `unsigned long'.
(main): Remove unused parameter `envp'.
Cast assignment to `lang_expand_expr' to a `lang_expand_expr_t'.
Cast -1 when comparing it with a `size_t'.
* toplev.h (fatal, fatal_io_error, pfatal_with_name): Mark
prototype with ATTRIBUTE_NORETURN.
(fatal_insn_not_found, fatal_insn, really_sorry,
push_float_handler, pop_float_handler): Add prototypes.
(fancy_abort): Mark prototype with ATTRIBUTE_NORETURN.
(do_abort, botch): Add prototypes.
From-SVN: r22293
1998-09-06 07:56:20 +02:00
unsigned long i ;
cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
* cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
Instead of writing to const char *buf directly, use a non-const
variable `wbuf' to allocate and write a string, then set buf = wbuf.
* cppulp.c (user_label_prefix): Qualify a char* with the `const'
keyword.
* dyn-string.c (dyn_string_append): Likewise.
* dyn-string.h (dyn_string_append): Likewise.
* final.c (end_final, output_operand_lossage, asm_fprintf): Likewise.
* output.h (end_final, output_operand_lossage, asm_fprintf,
named_section, decode_reg_name, make_decl_rtl, user_label_prefix):
Likewise.
* profile.c (init_branch_prob): Likewise.
* toplev.c (set_target_switch, vmessage,
v_message_with_file_and_line, v_message_with_decl,
v_error_with_file_and_line, v_error_with_decl, v_error_for_asm,
verror, vfatal, v_warning_with_file_and_line, v_warning_with_decl,
v_warning_for_asm, vwarning, vpedwarn, v_pedwarn_with_decl,
v_pedwarn_with_file_and_line, vsorry, v_really_sorry,
open_dump_file, dump_rtl, clean_dump_file,
print_version, print_single_switch, print_switch_values,
dump_base_name, debug_args, lang_independent_options,
user_label_prefix, documented_lang_options, target_switches,
target_options, print_time, pfatal_with_name, fatal_io_error,
fatal_insn, default_print_error_function, print_error_function,
report_error_function, error_with_file_and_line, error_with_decl,
error_for_asm, error, fatal, warning_with_file_and_line,
warning_with_decl, warning_for_asm, warning, pedwarn,
pedwarn_with_decl, pedwarn_with_file_and_line, sorry,
really_sorry, botch, output_quoted_string, output_file_directive,
open_dump_file, rest_of_decl_compilation, display_help, main):
Likewise.
* toplev.h (print_time, fatal, fatal_io_error, pfatal_with_name,
fatal_insn, warning, error, pedwarn, pedwarn_with_file_and_line,
warning_with_file_and_line, error_with_file_and_line, sorry,
really_sorry, default_print_error_function, report_error_function,
rest_of_decl_compilation, pedwarn_with_decl, warning_with_decl,
error_with_decl, error_for_asm, warning_for_asm, output_quoted_string,
output_file_directive, botch): Likewise.
* tree.h (make_decl_rtl): Likewise.
* varasm.c (strip_reg_name, named_section, decode_reg_name,
make_decl_rtl): Likewise.
From-SVN: r24743
1999-01-18 09:53:41 +01:00
const char * lang ;
1998-07-13 19:20:29 +02:00
1998-07-14 16:18:56 +02:00
# ifndef USE_CPPLIB
1998-07-13 19:20:29 +02:00
printf ( " Usage: %s input [switches] \n " , progname ) ;
printf ( " Switches: \n " ) ;
1998-07-14 16:18:56 +02:00
# endif
1998-07-13 19:20:29 +02:00
printf ( " -ffixed-<register> Mark <register> as being unavailable to the compiler \n " ) ;
printf ( " -fcall-used-<register> Mark <register> as being corrupted by function calls \n " ) ;
printf ( " -fcall-saved-<register> Mark <register> as being preserved across functions \n " ) ;
flags.h: New variables align_loops...
* flags.h: New variables align_loops, align_loops_log,
align_jumps, align_jumps_log, align_labels, align_labels_log,
align_functions, align_functions_log.
* toplev.c: Define them.
(f_options): Handle -falign-* when they have no argument.
(main): Add logic to set variables for -falign-functions,
-falign-jumps, -falign-labels, -falign-loops.
Make it -fsched-verbose=<n> and -finline-limit=<n>.
(display_help): Change help to match options.
* final.c (LABEL_ALIGN): Default to align_labels_log.
(LABEL_ALIGN_MAX_SKIP): Default to align_labels-1.
(LOOP_ALIGN): Default to align_loops_log.
(LOOP_ALIGN_MAX_SKIP): Default to align_loops-1.
(LABEL_ALIGN_AFTER_BARRIER): Default to align_jumps_log.
(LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP): Default to align_jumps-1.
* varasm.c (assemble_start_function): Handle align_functions.
* config/sparc/sparc.h: Don't declare sparc_align_*.
Don't provide LABEL_ALIGN_AFTER_BARRIER or LOOP_ALIGN.
(DEFAULT_SPARC_ALIGN_FUNCS): Delete; take functionality into
sparc.c.
(FUNCTION_BOUNDARY): Fix incorrect use---it's not just a request,
it's a promise.
* config/sparc/sparc.c: Delete sparc_align_loops,
sparc_align_jumps, sparc_align_funcs and the corresponding string
variables.
(sparc_override_options): Default align_functions on ultrasparc.
Delete -malign-* handling.
* config/mips/mips.c (override_options): On 64-bit targets,
try to align code to 64-bit boundaries.
(print_operand): New substitution, %~,
which aligns labels to align_labels_log.
* config/mips/mips.md (div_trap_normal): Use %~.
(div_trap_mips16): Likewise.
(abssi): Likewise.
(absdi2): Likewise.
(ffssi2): Likewise.
(ffsdi2): Likewise.
(ashldi3_internal): Likewise.
(ashrdi3_internal): Likewise.
(lshrdi3_internal): Likewise.
(casesi_internal): Likewise.
Plus corresponding documentation changes.
From-SVN: r29045
1999-09-02 07:42:06 +02:00
printf ( " -finline-limit=<number> Limits the size of inlined functions to <number> \n " ) ;
1998-07-13 19:20:29 +02:00
for ( i = NUM_ELEM ( f_options ) ; i - - ; )
{
cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
* cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
Instead of writing to const char *buf directly, use a non-const
variable `wbuf' to allocate and write a string, then set buf = wbuf.
* cppulp.c (user_label_prefix): Qualify a char* with the `const'
keyword.
* dyn-string.c (dyn_string_append): Likewise.
* dyn-string.h (dyn_string_append): Likewise.
* final.c (end_final, output_operand_lossage, asm_fprintf): Likewise.
* output.h (end_final, output_operand_lossage, asm_fprintf,
named_section, decode_reg_name, make_decl_rtl, user_label_prefix):
Likewise.
* profile.c (init_branch_prob): Likewise.
* toplev.c (set_target_switch, vmessage,
v_message_with_file_and_line, v_message_with_decl,
v_error_with_file_and_line, v_error_with_decl, v_error_for_asm,
verror, vfatal, v_warning_with_file_and_line, v_warning_with_decl,
v_warning_for_asm, vwarning, vpedwarn, v_pedwarn_with_decl,
v_pedwarn_with_file_and_line, vsorry, v_really_sorry,
open_dump_file, dump_rtl, clean_dump_file,
print_version, print_single_switch, print_switch_values,
dump_base_name, debug_args, lang_independent_options,
user_label_prefix, documented_lang_options, target_switches,
target_options, print_time, pfatal_with_name, fatal_io_error,
fatal_insn, default_print_error_function, print_error_function,
report_error_function, error_with_file_and_line, error_with_decl,
error_for_asm, error, fatal, warning_with_file_and_line,
warning_with_decl, warning_for_asm, warning, pedwarn,
pedwarn_with_decl, pedwarn_with_file_and_line, sorry,
really_sorry, botch, output_quoted_string, output_file_directive,
open_dump_file, rest_of_decl_compilation, display_help, main):
Likewise.
* toplev.h (print_time, fatal, fatal_io_error, pfatal_with_name,
fatal_insn, warning, error, pedwarn, pedwarn_with_file_and_line,
warning_with_file_and_line, error_with_file_and_line, sorry,
really_sorry, default_print_error_function, report_error_function,
rest_of_decl_compilation, pedwarn_with_decl, warning_with_decl,
error_with_decl, error_for_asm, warning_for_asm, output_quoted_string,
output_file_directive, botch): Likewise.
* tree.h (make_decl_rtl): Likewise.
* varasm.c (strip_reg_name, named_section, decode_reg_name,
make_decl_rtl): Likewise.
From-SVN: r24743
1999-01-18 09:53:41 +01:00
const char * description = f_options [ i ] . description ;
1998-07-13 19:20:29 +02:00
if ( description ! = NULL & & * description ! = 0 )
printf ( " -f%-21s %s \n " ,
f_options [ i ] . string , description ) ;
}
printf ( " -O[number] Set optimisation level to [number] \n " ) ;
printf ( " -Os Optimise for space rather than speed \n " ) ;
printf ( " -pedantic Issue warnings needed by strict compliance to ANSI C \n " ) ;
printf ( " -pedantic-errors Like -pedantic except that errors are produced \n " ) ;
printf ( " -w Suppress warnings \n " ) ;
printf ( " -W Enable extra warnings \n " ) ;
for ( i = NUM_ELEM ( W_options ) ; i - - ; )
{
cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
* cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
Instead of writing to const char *buf directly, use a non-const
variable `wbuf' to allocate and write a string, then set buf = wbuf.
* cppulp.c (user_label_prefix): Qualify a char* with the `const'
keyword.
* dyn-string.c (dyn_string_append): Likewise.
* dyn-string.h (dyn_string_append): Likewise.
* final.c (end_final, output_operand_lossage, asm_fprintf): Likewise.
* output.h (end_final, output_operand_lossage, asm_fprintf,
named_section, decode_reg_name, make_decl_rtl, user_label_prefix):
Likewise.
* profile.c (init_branch_prob): Likewise.
* toplev.c (set_target_switch, vmessage,
v_message_with_file_and_line, v_message_with_decl,
v_error_with_file_and_line, v_error_with_decl, v_error_for_asm,
verror, vfatal, v_warning_with_file_and_line, v_warning_with_decl,
v_warning_for_asm, vwarning, vpedwarn, v_pedwarn_with_decl,
v_pedwarn_with_file_and_line, vsorry, v_really_sorry,
open_dump_file, dump_rtl, clean_dump_file,
print_version, print_single_switch, print_switch_values,
dump_base_name, debug_args, lang_independent_options,
user_label_prefix, documented_lang_options, target_switches,
target_options, print_time, pfatal_with_name, fatal_io_error,
fatal_insn, default_print_error_function, print_error_function,
report_error_function, error_with_file_and_line, error_with_decl,
error_for_asm, error, fatal, warning_with_file_and_line,
warning_with_decl, warning_for_asm, warning, pedwarn,
pedwarn_with_decl, pedwarn_with_file_and_line, sorry,
really_sorry, botch, output_quoted_string, output_file_directive,
open_dump_file, rest_of_decl_compilation, display_help, main):
Likewise.
* toplev.h (print_time, fatal, fatal_io_error, pfatal_with_name,
fatal_insn, warning, error, pedwarn, pedwarn_with_file_and_line,
warning_with_file_and_line, error_with_file_and_line, sorry,
really_sorry, default_print_error_function, report_error_function,
rest_of_decl_compilation, pedwarn_with_decl, warning_with_decl,
error_with_decl, error_for_asm, warning_for_asm, output_quoted_string,
output_file_directive, botch): Likewise.
* tree.h (make_decl_rtl): Likewise.
* varasm.c (strip_reg_name, named_section, decode_reg_name,
make_decl_rtl): Likewise.
From-SVN: r24743
1999-01-18 09:53:41 +01:00
const char * description = W_options [ i ] . description ;
1998-07-13 19:20:29 +02:00
if ( description ! = NULL & & * description ! = 0 )
printf ( " -W%-21s %s \n " ,
W_options [ i ] . string , description ) ;
}
printf ( " -Wid-clash-<num> Warn if 2 identifiers have the same first <num> chars \n " ) ;
printf ( " -Wlarger-than-<number> Warn if an object is larger than <number> bytes \n " ) ;
printf ( " -p Enable function profiling \n " ) ;
# if defined (BLOCK_PROFILER) || defined (FUNCTION_BLOCK_PROFILER)
printf ( " -a Enable block profiling \n " ) ;
# endif
# if defined (BLOCK_PROFILER) || defined (FUNCTION_BLOCK_PROFILER) || defined FUNCTION_BLOCK_PROFILER_EXIT
printf ( " -ax Enable jump profiling \n " ) ;
# endif
printf ( " -o <file> Place output into <file> \n " ) ;
printf ( " -G <number> Put global and static data smaller than <number> \n " ) ;
1998-07-14 16:18:56 +02:00
printf ( " bytes into a special section (on some targets) \n " ) ;
1998-07-13 19:20:29 +02:00
for ( i = NUM_ELEM ( debug_args ) ; i - - ; )
{
if ( debug_args [ i ] . description ! = NULL )
1999-09-20 15:48:12 +02:00
printf ( " -g%-21s %s \n " , debug_args [ i ] . arg , debug_args [ i ] . description ) ;
1998-07-13 19:20:29 +02:00
}
printf ( " -aux-info <file> Emit declaration info into <file>.X \n " ) ;
printf ( " -quiet Do not display functions compiled or elapsed time \n " ) ;
printf ( " -version Display the compiler's version \n " ) ;
printf ( " -d[letters] Enable dumps from specific passes of the compiler \n " ) ;
printf ( " -dumpbase <file> Base name to be used for dumps from specific passes \n " ) ;
1999-08-24 05:28:57 +02:00
# if defined INSN_SCHEDULING
flags.h: New variables align_loops...
* flags.h: New variables align_loops, align_loops_log,
align_jumps, align_jumps_log, align_labels, align_labels_log,
align_functions, align_functions_log.
* toplev.c: Define them.
(f_options): Handle -falign-* when they have no argument.
(main): Add logic to set variables for -falign-functions,
-falign-jumps, -falign-labels, -falign-loops.
Make it -fsched-verbose=<n> and -finline-limit=<n>.
(display_help): Change help to match options.
* final.c (LABEL_ALIGN): Default to align_labels_log.
(LABEL_ALIGN_MAX_SKIP): Default to align_labels-1.
(LOOP_ALIGN): Default to align_loops_log.
(LOOP_ALIGN_MAX_SKIP): Default to align_loops-1.
(LABEL_ALIGN_AFTER_BARRIER): Default to align_jumps_log.
(LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP): Default to align_jumps-1.
* varasm.c (assemble_start_function): Handle align_functions.
* config/sparc/sparc.h: Don't declare sparc_align_*.
Don't provide LABEL_ALIGN_AFTER_BARRIER or LOOP_ALIGN.
(DEFAULT_SPARC_ALIGN_FUNCS): Delete; take functionality into
sparc.c.
(FUNCTION_BOUNDARY): Fix incorrect use---it's not just a request,
it's a promise.
* config/sparc/sparc.c: Delete sparc_align_loops,
sparc_align_jumps, sparc_align_funcs and the corresponding string
variables.
(sparc_override_options): Default align_functions on ultrasparc.
Delete -malign-* handling.
* config/mips/mips.c (override_options): On 64-bit targets,
try to align code to 64-bit boundaries.
(print_operand): New substitution, %~,
which aligns labels to align_labels_log.
* config/mips/mips.md (div_trap_normal): Use %~.
(div_trap_mips16): Likewise.
(abssi): Likewise.
(absdi2): Likewise.
(ffssi2): Likewise.
(ffsdi2): Likewise.
(ashldi3_internal): Likewise.
(ashrdi3_internal): Likewise.
(lshrdi3_internal): Likewise.
(casesi_internal): Likewise.
Plus corresponding documentation changes.
From-SVN: r29045
1999-09-02 07:42:06 +02:00
printf ( " -sched-verbose=<number> Set the verbosity level of the scheduler \n " ) ;
1998-07-13 19:20:29 +02:00
# endif
printf ( " --help Display this information \n " ) ;
undoc = 0 ;
lang = " language " ;
/* Display descriptions of language specific options.
If there is no description , note that there is an undocumented option .
If the description is empty , do not display anything . ( This allows
options to be deliberately undocumented , for whatever reason ) .
If the option string is missing , then this is a marker , indicating
1998-09-28 21:13:25 +02:00
that the description string is in fact the name of a language , whose
1998-07-13 19:20:29 +02:00
language specific options are to follow . */
if ( NUM_ELEM ( documented_lang_options ) > 1 )
{
printf ( " \n Language specific options: \n " ) ;
for ( i = 0 ; i < NUM_ELEM ( documented_lang_options ) ; i + + )
{
cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
* cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
Instead of writing to const char *buf directly, use a non-const
variable `wbuf' to allocate and write a string, then set buf = wbuf.
* cppulp.c (user_label_prefix): Qualify a char* with the `const'
keyword.
* dyn-string.c (dyn_string_append): Likewise.
* dyn-string.h (dyn_string_append): Likewise.
* final.c (end_final, output_operand_lossage, asm_fprintf): Likewise.
* output.h (end_final, output_operand_lossage, asm_fprintf,
named_section, decode_reg_name, make_decl_rtl, user_label_prefix):
Likewise.
* profile.c (init_branch_prob): Likewise.
* toplev.c (set_target_switch, vmessage,
v_message_with_file_and_line, v_message_with_decl,
v_error_with_file_and_line, v_error_with_decl, v_error_for_asm,
verror, vfatal, v_warning_with_file_and_line, v_warning_with_decl,
v_warning_for_asm, vwarning, vpedwarn, v_pedwarn_with_decl,
v_pedwarn_with_file_and_line, vsorry, v_really_sorry,
open_dump_file, dump_rtl, clean_dump_file,
print_version, print_single_switch, print_switch_values,
dump_base_name, debug_args, lang_independent_options,
user_label_prefix, documented_lang_options, target_switches,
target_options, print_time, pfatal_with_name, fatal_io_error,
fatal_insn, default_print_error_function, print_error_function,
report_error_function, error_with_file_and_line, error_with_decl,
error_for_asm, error, fatal, warning_with_file_and_line,
warning_with_decl, warning_for_asm, warning, pedwarn,
pedwarn_with_decl, pedwarn_with_file_and_line, sorry,
really_sorry, botch, output_quoted_string, output_file_directive,
open_dump_file, rest_of_decl_compilation, display_help, main):
Likewise.
* toplev.h (print_time, fatal, fatal_io_error, pfatal_with_name,
fatal_insn, warning, error, pedwarn, pedwarn_with_file_and_line,
warning_with_file_and_line, error_with_file_and_line, sorry,
really_sorry, default_print_error_function, report_error_function,
rest_of_decl_compilation, pedwarn_with_decl, warning_with_decl,
error_with_decl, error_for_asm, warning_for_asm, output_quoted_string,
output_file_directive, botch): Likewise.
* tree.h (make_decl_rtl): Likewise.
* varasm.c (strip_reg_name, named_section, decode_reg_name,
make_decl_rtl): Likewise.
From-SVN: r24743
1999-01-18 09:53:41 +01:00
const char * description = documented_lang_options [ i ] . description ;
const char * option = documented_lang_options [ i ] . option ;
1998-07-13 19:20:29 +02:00
if ( description = = NULL )
1998-10-27 14:26:51 +01:00
{
undoc = 1 ;
if ( extra_warnings )
printf ( " %-23.23s [undocumented] \n " , option ) ;
}
1998-07-13 19:20:29 +02:00
else if ( * description = = 0 )
continue ;
else if ( option = = NULL )
{
if ( undoc )
printf
( " \n There are undocumented %s specific options as well. \n " ,
lang ) ;
undoc = 0 ;
printf ( " \n Options for %s: \n " , description ) ;
lang = description ;
}
else
printf ( " %-23.23s %s \n " , option , description ) ;
}
}
if ( undoc )
printf ( " \n There are undocumented %s specific options as well. \n " , lang ) ;
if ( NUM_ELEM ( target_switches ) > 1
# ifdef TARGET_OPTIONS
| | NUM_ELEM ( target_options ) > 1
# endif
)
{
int doc = 0 ;
undoc = 0 ;
printf ( " \n Target specific options: \n " ) ;
for ( i = NUM_ELEM ( target_switches ) ; i - - ; )
{
cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
* cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
Instead of writing to const char *buf directly, use a non-const
variable `wbuf' to allocate and write a string, then set buf = wbuf.
* cppulp.c (user_label_prefix): Qualify a char* with the `const'
keyword.
* dyn-string.c (dyn_string_append): Likewise.
* dyn-string.h (dyn_string_append): Likewise.
* final.c (end_final, output_operand_lossage, asm_fprintf): Likewise.
* output.h (end_final, output_operand_lossage, asm_fprintf,
named_section, decode_reg_name, make_decl_rtl, user_label_prefix):
Likewise.
* profile.c (init_branch_prob): Likewise.
* toplev.c (set_target_switch, vmessage,
v_message_with_file_and_line, v_message_with_decl,
v_error_with_file_and_line, v_error_with_decl, v_error_for_asm,
verror, vfatal, v_warning_with_file_and_line, v_warning_with_decl,
v_warning_for_asm, vwarning, vpedwarn, v_pedwarn_with_decl,
v_pedwarn_with_file_and_line, vsorry, v_really_sorry,
open_dump_file, dump_rtl, clean_dump_file,
print_version, print_single_switch, print_switch_values,
dump_base_name, debug_args, lang_independent_options,
user_label_prefix, documented_lang_options, target_switches,
target_options, print_time, pfatal_with_name, fatal_io_error,
fatal_insn, default_print_error_function, print_error_function,
report_error_function, error_with_file_and_line, error_with_decl,
error_for_asm, error, fatal, warning_with_file_and_line,
warning_with_decl, warning_for_asm, warning, pedwarn,
pedwarn_with_decl, pedwarn_with_file_and_line, sorry,
really_sorry, botch, output_quoted_string, output_file_directive,
open_dump_file, rest_of_decl_compilation, display_help, main):
Likewise.
* toplev.h (print_time, fatal, fatal_io_error, pfatal_with_name,
fatal_insn, warning, error, pedwarn, pedwarn_with_file_and_line,
warning_with_file_and_line, error_with_file_and_line, sorry,
really_sorry, default_print_error_function, report_error_function,
rest_of_decl_compilation, pedwarn_with_decl, warning_with_decl,
error_with_decl, error_for_asm, warning_for_asm, output_quoted_string,
output_file_directive, botch): Likewise.
* tree.h (make_decl_rtl): Likewise.
* varasm.c (strip_reg_name, named_section, decode_reg_name,
make_decl_rtl): Likewise.
From-SVN: r24743
1999-01-18 09:53:41 +01:00
const char * option = target_switches [ i ] . name ;
const char * description = target_switches [ i ] . description ;
1998-07-13 19:20:29 +02:00
1998-10-27 14:26:51 +01:00
if ( option = = NULL | | * option = = 0 )
1998-07-13 19:20:29 +02:00
continue ;
else if ( description = = NULL )
1998-10-27 14:26:51 +01:00
{
undoc = 1 ;
if ( extra_warnings )
printf ( " -m%-21.21s [undocumented] \n " , option ) ;
}
1998-07-13 19:20:29 +02:00
else if ( * description ! = 0 )
1998-10-17 13:04:29 +02:00
doc + = printf ( " -m%-21.21s %s \n " , option , description ) ;
1998-07-13 19:20:29 +02:00
}
# ifdef TARGET_OPTIONS
for ( i = NUM_ELEM ( target_options ) ; i - - ; )
{
cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
* cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
Instead of writing to const char *buf directly, use a non-const
variable `wbuf' to allocate and write a string, then set buf = wbuf.
* cppulp.c (user_label_prefix): Qualify a char* with the `const'
keyword.
* dyn-string.c (dyn_string_append): Likewise.
* dyn-string.h (dyn_string_append): Likewise.
* final.c (end_final, output_operand_lossage, asm_fprintf): Likewise.
* output.h (end_final, output_operand_lossage, asm_fprintf,
named_section, decode_reg_name, make_decl_rtl, user_label_prefix):
Likewise.
* profile.c (init_branch_prob): Likewise.
* toplev.c (set_target_switch, vmessage,
v_message_with_file_and_line, v_message_with_decl,
v_error_with_file_and_line, v_error_with_decl, v_error_for_asm,
verror, vfatal, v_warning_with_file_and_line, v_warning_with_decl,
v_warning_for_asm, vwarning, vpedwarn, v_pedwarn_with_decl,
v_pedwarn_with_file_and_line, vsorry, v_really_sorry,
open_dump_file, dump_rtl, clean_dump_file,
print_version, print_single_switch, print_switch_values,
dump_base_name, debug_args, lang_independent_options,
user_label_prefix, documented_lang_options, target_switches,
target_options, print_time, pfatal_with_name, fatal_io_error,
fatal_insn, default_print_error_function, print_error_function,
report_error_function, error_with_file_and_line, error_with_decl,
error_for_asm, error, fatal, warning_with_file_and_line,
warning_with_decl, warning_for_asm, warning, pedwarn,
pedwarn_with_decl, pedwarn_with_file_and_line, sorry,
really_sorry, botch, output_quoted_string, output_file_directive,
open_dump_file, rest_of_decl_compilation, display_help, main):
Likewise.
* toplev.h (print_time, fatal, fatal_io_error, pfatal_with_name,
fatal_insn, warning, error, pedwarn, pedwarn_with_file_and_line,
warning_with_file_and_line, error_with_file_and_line, sorry,
really_sorry, default_print_error_function, report_error_function,
rest_of_decl_compilation, pedwarn_with_decl, warning_with_decl,
error_with_decl, error_for_asm, warning_for_asm, output_quoted_string,
output_file_directive, botch): Likewise.
* tree.h (make_decl_rtl): Likewise.
* varasm.c (strip_reg_name, named_section, decode_reg_name,
make_decl_rtl): Likewise.
From-SVN: r24743
1999-01-18 09:53:41 +01:00
const char * option = target_options [ i ] . prefix ;
const char * description = target_options [ i ] . description ;
1998-07-13 19:20:29 +02:00
1998-10-27 14:26:51 +01:00
if ( option = = NULL | | * option = = 0 )
1998-07-13 19:20:29 +02:00
continue ;
else if ( description = = NULL )
1998-10-27 14:26:51 +01:00
{
undoc = 1 ;
if ( extra_warnings )
printf ( " -m%-21.21s [undocumented] \n " , option ) ;
}
1998-07-13 19:20:29 +02:00
else if ( * description ! = 0 )
1998-10-17 13:04:29 +02:00
doc + = printf ( " -m%-21.21s %s \n " , option , description ) ;
1998-07-13 19:20:29 +02:00
}
# endif
if ( undoc )
1998-08-13 18:12:55 +02:00
{
if ( doc )
printf ( " \n There are undocumented target specific options as well. \n " ) ;
else
printf ( " They exist, but they are not documented. \n " ) ;
}
1998-07-13 19:20:29 +02:00
}
}
1999-09-20 15:48:12 +02:00
/* Parse a -d... comand line switch. */
static void
decode_d_option ( arg )
const char * arg ;
{
while ( * arg )
switch ( * arg + + )
{
case ' a ' :
branch_prob_dump = 1 ;
combine_dump = 1 ;
# ifdef DELAY_SLOTS
dbr_sched_dump = 1 ;
# endif
flow_dump = 1 ;
flow2_dump = 1 ;
global_reg_dump = 1 ;
jump_opt_dump = 1 ;
addressof_dump = 1 ;
jump2_opt_dump = 1 ;
local_reg_dump = 1 ;
loop_dump = 1 ;
regmove_dump = 1 ;
rtl_dump = 1 ;
cse_dump = 1 ;
cse2_dump = 1 ;
gcse_dump = 1 ;
sched_dump = 1 ;
sched2_dump = 1 ;
# ifdef STACK_REGS
stack_reg_dump = 1 ;
# endif
# ifdef MACHINE_DEPENDENT_REORG
mach_dep_reorg_dump = 1 ;
# endif
peephole2_dump = 1 ;
break ;
case ' A ' :
flag_debug_asm = 1 ;
break ;
case ' b ' :
branch_prob_dump = 1 ;
break ;
case ' c ' :
combine_dump = 1 ;
break ;
# ifdef DELAY_SLOTS
case ' d ' :
dbr_sched_dump = 1 ;
break ;
# endif
case ' f ' :
flow_dump = 1 ;
break ;
case ' F ' :
addressof_dump = 1 ;
break ;
case ' g ' :
global_reg_dump = 1 ;
break ;
case ' G ' :
gcse_dump = 1 ;
break ;
case ' j ' :
jump_opt_dump = 1 ;
break ;
case ' J ' :
jump2_opt_dump = 1 ;
break ;
# ifdef STACK_REGS
case ' k ' :
stack_reg_dump = 1 ;
break ;
# endif
case ' l ' :
local_reg_dump = 1 ;
break ;
case ' L ' :
loop_dump = 1 ;
break ;
case ' m ' :
flag_print_mem = 1 ;
break ;
# ifdef MACHINE_DEPENDENT_REORG
case ' M ' :
mach_dep_reorg_dump = 1 ;
break ;
# endif
case ' p ' :
flag_print_asm_name = 1 ;
break ;
case ' r ' :
rtl_dump = 1 ;
break ;
case ' R ' :
sched2_dump = 1 ;
break ;
case ' s ' :
cse_dump = 1 ;
break ;
case ' S ' :
sched_dump = 1 ;
break ;
case ' t ' :
cse2_dump = 1 ;
break ;
case ' N ' :
regmove_dump = 1 ;
break ;
case ' v ' :
graph_dump_format = vcg ;
break ;
case ' w ' :
flow2_dump = 1 ;
break ;
case ' x ' :
rtl_dump_and_exit = 1 ;
break ;
case ' y ' :
set_yydebug ( 1 ) ;
break ;
case ' z ' :
peephole2_dump = 1 ;
break ;
case ' D ' : /* These are handled by the preprocessor. */
case ' I ' :
break ;
default :
warning ( " unrecognised gcc debugging option: %c " , arg [ - 1 ] ) ;
break ;
}
}
1998-07-13 19:20:29 +02:00
1999-09-20 15:48:12 +02:00
/* Parse a -f... comand line switch. ARG is the value after the -f.
It is safe to access ' ARG - 2 ' to generate the full switch name .
Return the number of strings consumed . */
1998-07-13 19:20:29 +02:00
static int
1999-09-20 15:48:12 +02:00
decode_f_option ( arg )
const char * arg ;
1998-07-13 19:20:29 +02:00
{
1999-09-20 15:48:12 +02:00
int j ;
/* Search for the option in the table of binary f options. */
for ( j = sizeof ( f_options ) / sizeof ( f_options [ 0 ] ) ; j - - ; )
{
if ( ! strcmp ( arg , f_options [ j ] . string ) )
{
* f_options [ j ] . variable = f_options [ j ] . on_value ;
return 1 ;
}
if ( arg [ 0 ] = = ' n ' & & arg [ 1 ] = = ' o ' & & arg [ 2 ] = = ' - '
& & ! strcmp ( arg + 3 , f_options [ j ] . string ) )
{
* f_options [ j ] . variable = ! f_options [ j ] . on_value ;
return 1 ;
}
}
1998-07-13 19:20:29 +02:00
1999-09-20 15:48:12 +02:00
if ( ! strncmp ( arg , " inline-limit- " , 13 )
| | ! strncmp ( arg , " inline-limit= " , 13 ) )
inline_max_insns =
read_integral_parameter ( arg + 13 , arg - 2 , inline_max_insns ) ;
# ifdef INSN_SCHEDULING
else if ( ! strncmp ( arg , " sched-verbose= " , 14 ) )
1999-10-26 20:13:38 +02:00
fix_sched_param ( " verbose " , ( const char * ) ( arg + 14 ) ) ;
1999-09-20 15:48:12 +02:00
# endif
else if ( ! strncmp ( arg , " fixed- " , 6 ) )
1999-10-26 20:13:38 +02:00
fix_register ( ( const char * ) ( arg + 6 ) , 1 , 1 ) ;
1999-09-20 15:48:12 +02:00
else if ( ! strncmp ( arg , " call-used- " , 10 ) )
1999-10-26 20:13:38 +02:00
fix_register ( ( const char * ) ( arg + 10 ) , 0 , 1 ) ;
1999-09-20 15:48:12 +02:00
else if ( ! strncmp ( arg , " call-saved- " , 11 ) )
1999-10-26 20:13:38 +02:00
fix_register ( ( const char * ) ( arg + 11 ) , 0 , 0 ) ;
1999-09-20 15:48:12 +02:00
else if ( ! strncmp ( arg , " align-loops= " , 12 ) )
align_loops = read_integral_parameter ( arg + 12 , arg - 2 , align_loops ) ;
else if ( ! strncmp ( arg , " align-functions= " , 16 ) )
align_functions =
read_integral_parameter ( arg + 16 , arg - 2 , align_functions ) ;
else if ( ! strncmp ( arg , " align-jumps= " , 12 ) )
align_jumps = read_integral_parameter ( arg + 12 , arg - 2 , align_jumps ) ;
else if ( ! strncmp ( arg , " align-labels= " , 13 ) )
align_labels = read_integral_parameter ( arg + 13 , arg - 2 , align_labels ) ;
1999-12-04 04:00:04 +01:00
else if ( ! strncmp ( arg , " stack-limit-register= " , 21 ) )
{
int reg = decode_reg_name ( arg + 21 ) ;
if ( reg < 0 )
error ( " unrecognized register name `%s' " , arg + 21 ) ;
else
stack_limit_rtx = gen_rtx_REG ( Pmode , reg ) ;
}
else if ( ! strncmp ( arg , " stack-limit-symbol= " , 19 ) )
{
char * nm ;
if ( ggc_p )
nm = ggc_alloc_string ( arg + 19 , strlen ( arg + 19 ) ) ;
else
nm = xstrdup ( arg + 19 ) ;
stack_limit_rtx = gen_rtx_SYMBOL_REF ( Pmode , nm ) ;
}
else if ( ! strcmp ( arg , " no-stack-limit " ) )
stack_limit_rtx = NULL_RTX ;
1999-09-20 15:48:12 +02:00
else if ( ! strcmp ( arg , " preprocessed " ) )
/* Recognise this switch but do nothing. This prevents warnings
about an unrecognised switch if cpplib has not been linked in . */
;
1998-10-17 13:04:29 +02:00
else
1999-09-20 15:48:12 +02:00
return 0 ;
return 1 ;
}
/* Parse a -W... comand line switch. ARG is the value after the -W.
It is safe to access ' ARG - 2 ' to generate the full switch name .
Return the number of strings consumed . */
static int
decode_W_option ( arg )
const char * arg ;
{
int j ;
1998-10-17 13:04:29 +02:00
1999-09-20 15:48:12 +02:00
/* Search for the option in the table of binary W options. */
for ( j = sizeof ( W_options ) / sizeof ( W_options [ 0 ] ) ; j - - ; )
{
if ( ! strcmp ( arg , W_options [ j ] . string ) )
{
* W_options [ j ] . variable = W_options [ j ] . on_value ;
return 1 ;
}
if ( arg [ 0 ] = = ' n ' & & arg [ 1 ] = = ' o ' & & arg [ 2 ] = = ' - '
& & ! strcmp ( arg + 3 , W_options [ j ] . string ) )
{
* W_options [ j ] . variable = ! W_options [ j ] . on_value ;
return 1 ;
}
}
if ( ! strncmp ( arg , " id-clash- " , 9 ) )
{
const int id_clash_val = read_integral_parameter ( arg + 9 , arg - 2 , - 1 ) ;
if ( id_clash_val ! = - 1 )
{
id_clash_len = id_clash_val ;
warn_id_clash = 1 ;
}
}
else if ( ! strncmp ( arg , " larger-than- " , 12 ) )
{
const int larger_than_val =
read_integral_parameter ( arg + 12 , arg - 2 , - 1 ) ;
if ( larger_than_val ! = - 1 )
{
larger_than_size = larger_than_val ;
warn_larger_than = 1 ;
}
}
else
1998-07-13 19:20:29 +02:00
return 0 ;
1999-09-20 15:48:12 +02:00
return 1 ;
}
/* Parse a -g... comand line switch. ARG is the value after the -g.
It is safe to access ' ARG - 2 ' to generate the full switch name .
Return the number of strings consumed . */
[multiple changes]
Fri Oct 29 15:25:07 1999 Arnaud Charlet <charlet@ACT-Europe.FR>
* gcov.c (DIR_SEPARATOR): Provide default.
(output_data): Add test for MS-DOS format absolute filename.
(fancy_abort): Correct program name.
(open_files): Open all files in binary mode.
* libgcc2.c (__bb_exit_func): Likewise.
* profile.c (init_branch_prob): Specify binary when opening files.
* flags.h (flag_unwind_tables): New decl.
* toplev.c (flag_unwind_table): New definition.
(f_options): Add -funwind-tables.
(decode_g_option): Clarify warning when unknown -g option is given.
(rest_of_compilation): If inside an inlined external function,
pretend we are just being declared.
* dwarf2out.c (dwarf2out_do_frame): Check -funwind_tables.
(dwarf2out_frame_finish): Likewise.
Fri Oct 29 06:32:44 1999 Geoffrey Keating <geoffk@cygnus.com>
* flow.c (propagate_block): When the last reference to a label
before an ADDR_VEC is deleted because the reference is a dead
store, delete the ADDR_VEC.
Fri Oct 29 07:44:26 1999 Vasco Pedro <vp@di.fct.unl.pt>
* fold-const.c (merge_ranges): In not in0, but in1, handle
upper bounds equal like subset case.
Thu Oct 28 19:22:24 1999 Douglas Rupp <rupp@gnat.com>
* dbxout.c (dbxout_parms): Generate a second stabs line for parameters
passed in a register but moved to the stack.
Thu Oct 28 19:12:57 1999 Sam Tardieu <tardieu@act-europe.fr>
* gcc.c (pass_exit_codes, greatest_status): New variables.
(struct option_map): Add entry for "--pass-exit-codes".
(execute): Update greatest_status if error.
(display_help): Add documentation for -pass-exit-codes.
(process_command): Handle -pass-exit-codes.
(main): Look at pass_exit_codes and greatest_status on call to exit.
Thu Oct 28 18:06:50 1999 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* reload.c (find_reloads): Refine test for no input reload
case to not includes reloads emitted after insn.
* function.c (find_temp_slots_from_address): Handle sum involving
a register that points to a temp slot.
(update_temp_slot_address): Make recursive call if both old and
new are PLUS with a common operand.
* calls.c (expand_call): Mark temp slot for result as having
address taken.
* rtlanal.c (reg_referenced_p, case IF_THEN_ELSE): New case.
* gcc.c (process_command): Add standard_exec_prefix with "GCC"
component as well as "BINUTILS".
* integrate.h (copy_rtx_and_substitute): New arg, FOR_LHS.
* integrate.c (copy_rtx_and_substitute): Likewise.
(expand_inline_function, integrate_parm_decls, integrate_decl_tree):
All callers changed.
* unroll.c (inital_reg_note_copy, copy_loop_body): Likewise.
* dbxout.c (dbxout_type, case INTEGER_TYPE_NODE): If can use
gdb extensions, write size of type; also be more consistent
in using references when this is a subtype.
* pa.md (extv, extzv, insv): Use define_expand to reject constant
that is out of range.
* loop.c (unknown_constant_address_altered): New variable.
(prescan_loop): Initialize it.
(note_addr_stored): Set it for RTX_UNCHANGING_P MEM.
(invariant_p, case MEM): Remove handling for volatile and readony;
check new variable if readonly.
(check_dbra_loop): Chdeck unknown_constant_address_altered.
* cse.c (canon_hash, case MEM): Do not record if BLKmode.
(addr_affects_sp_p): Removed from note_mem_written and only
define #ifdef AUTO_INC_DEC.
* alpha.c (input_operand, case ADDRESSOF): Treat as REG.
* regclass.c (record_reg_classes): Properly handle register move
directions.
* varasm.c (initializer_constant_valid_p, case MINUS_EXPR):
Don't think valid if both operands are invalid.
(struct constant_descriptor): New field RTL.
(mark_const_hash_entry): Mark it.
(record_constant{,_rtx}): Initialize it.
(output_constant_def): Allocate RTL in permanent obstack and
save in table.
({record,compare}_constant_1): Modes must match for
CONSTRUCTOR of ARRAY_TYPE.
* c-common.h (initializer_constant_valid_p): Delete decl from here.
* output.h (initializer_constant_valid_p): Move decl to here.
* c-common.c (initializer_constant_valid_p): Delete function from here.
* varasm.c (initializer_constant_valid_p): Move function to here.
* tree.h (STRIP_SIGN_NOPS): New macro.
* fold-const.c (optimize_minmax_comparison): New function.
(invert_truthvalue, case WITH_RECORD_EXPR): New case.
(fold): Use STRIP_SIGN_NOPS instead of STRIP_TYPE_NOPS.
(fold, case EQ_EXPR): Call optimize_minmax_comparison and add
cases with ABS_EXPR, NEGATE_EXPR, PLUS_EXPR, MINUS_EXPR, and
widening conversions.
(fold, case LE_EXPR): Rework changing unsigned to signed comparisons
to look at size of mode, not precision of type; also add missing cases.
(optimize_bit_field_compare, decode_field_reference): Don't try to
optimize COMPONENT_REF of a PLACEHOLDER_EXPR.
* dwarf2out.c (ctype.h): Include.
(dwarf2out_set_demangle_name_func): New function.
(size_of_line_info): Deleted.
(output_line_info): Compute size of line info table from difference
of labels.
(base_type_die, add_name_attribute): Call demangle function, if any.
(field_byte_offset): Use bits per word for variable length fields.
(gen_array_type_die): Add array name.
(gen_subprogram_die): Ignore DECL_INLINE if -fno-inline.
(dwarf2out_add_library_unit_info): New function.
* explow.c (set_stack_check_libfunc): New function.
(stack_check_libfunc): New static variable.
(probe_stack_range): Allow front-end to set up a libfunc to call.
* combine.c (simplify_comparison): When making comparison in wider
mode, check for having commuted an AND and a SUBREG.
(contains_muldiv): New function.
(try_combine): Call it when dividing a PARALLEL.
(simplify_rtx, case TRUNCATE): Don't remove for umulsi3_highpart.
(simplify_comparison, case ASHIFTRT): Recognize sign-extension of
a PLUS.
(record_value_for_reg): If TEM is a binary operation with two CLOBBERs,
use one of the CLOBBERs instead.
(if_then_else_cond): If comparing against zero, just return thing
being compared.
* optabs.c (expand_abs): If machine has MAX, ABS (x) is MAX (x, -x).
Don't generate shifts and subtract if have conditional arithmetic.
* rtl.h (delete_barrier): New declaration.
* jump.c (jump_optimize): Set up to handle conditional call.
In conditional arithmetic case, handle CALL_INSN followed by a BARRIER.
(delete_barrier): New function.
* rtl.c (read_rtx): Call fatal if bad RTL code; check for bad mode.
* recog.c (nonmemory_operand): Accept ADDRESSOF.
* tree.c (build_type_attribute_variant): Push to obstack of
ttype around type_hash_canon call.
* expr.c (placeholder_list): Move decl to file scope.
(expand_expr): Don't force access to volatile just because its
address is taken.
If ignoring reference operations, just expand the operands.
(expand_expr, case COMPONENT_REF): Propagate
EXPAND_CONST_ADDRESS to recursive call when expanding inner.
Refine test for using bitfield operations vs pointer punning.
(expand_expr, case CONVERT_EXPR): If converting to
BLKmode UNION_TYPE from BLKmode, just return inner object.
Use proper mode in store_field call.
Properly set sizes of object to store and total size in store_field
call for convert to union.
(expand_expr, case ARRAY_REF): If OP0 is in a register, put it in
memory (like for ADDR_EXPR). Also, don't put constant in register if
we'll want it in memory.
(readonly_fields_p): New function.
(expand_expr, case INDIRECT_REF): Call it if LHS.
(expand_assignment): Handle a RESULT_DECL where
DECL_RTL is a PARALLEL.
(do_jump, case WITH_RECORD_EXPR): New case.
(get_inner_reference): Always go inside a CONVERT_EXPR
and NOP_EXPR if both modes are the same.
(store_field): Use bitfield operations if size of bitsize is not same
as size of RHS's type.
Check for bitpos not a multiple of alignment in BLKmode case.
Do block move in largest possible alignment.
(store_constructor): Set BITSIZE to -1 for variable size and properly
in case of array of BLKmode.
(expand_expr_unaligned): New function.
(do_compare_and_jump): Call it.
* mips/iris5.h (SWITCHES_NEED_SPACES): New macro.
* collect2.c (main): Only allow -ofoo if SWITCHES_NEED_SPACES
does not include 'o'.
* function.c (instantiate_virtual_regs_1, case SET): Handle case where
both SET_DEST and SET_SRC reference a virtual register.
(gen_mem_addressof): Copy RTX_UNCHANGING_P from new REG to old REG.
* integrate.c (expand_inline_function): Handle case of setting
virtual stack vars register (from built in setjmp); when parameter
lives in memory, expand virtual_{stack_vars,incoming_args}_rtx early.
(subst_constant): Add new parm, MEMONLY.
(expand_inline_function, integrate_parm_decls): Pass new parm.
(integrate_decl_tree): Likewise.
(copy_rtx_and_substitute, case MEM): Do copy RTX_UNCHANGING_P.
(try_constants): Call subst_constants twice, with MEMONLY 0 and 1.
(copy_rtx_and_substitute, case SET): Add explicit calls to
copy_rtx_and_substitute for both sides.
* stmt.c (expand_asm_operands): Don't use TREE_STRING_LENGTH for
constraints.
(pushcase{,_range}): Convert to NOMINAL_TYPE after checking for
within INDEX_TYPE, instead of before.
(fixup_gotos): Use f->target_rtl, not the next insn,
since latter may be from a later fixup.
(expand_value_return): Correctly convert VAL when promoting function
return; support RETURN_REG being a PARALLEL.
(expand_return): When checking for result in regs and having
cleanup, consider PARALLEL in DECL_RTL as being in regs.
From-SVN: r30299
1999-11-01 02:11:22 +01:00
1999-09-20 15:48:12 +02:00
static int
decode_g_option ( arg )
const char * arg ;
{
unsigned level ;
/* A lot of code assumes write_symbols == NO_DEBUG if the
debugging level is 0 ( thus - gstabs1 - gstabs0 would lose track
of what debugging type has been selected ) . This records the
selected type . It is an error to specify more than one
debugging type . */
static enum debug_info_type selected_debug_type = NO_DEBUG ;
/* Non-zero if debugging format has been explicitly set.
- g and - ggdb don ' t explicitly set the debugging format so
- gdwarf - g3 is equivalent to - gdwarf3 . */
static int type_explicitly_set_p = 0 ;
/* Indexed by enum debug_info_type. */
static const char * debug_type_names [ ] =
{
" none " , " stabs " , " coff " , " dwarf-1 " , " dwarf-2 " , " xcoff "
} ;
1998-10-17 13:04:29 +02:00
1999-09-20 15:48:12 +02:00
/* The maximum admissible debug level value. */
static const unsigned max_debug_level = 3 ;
1998-10-17 13:04:29 +02:00
1999-09-20 15:48:12 +02:00
/* Look up ARG in the table. */
for ( da = debug_args ; da - > arg ; da + + )
{
const int da_len = strlen ( da - > arg ) ;
if ( da_len = = 0 | | ! strncmp ( arg , da - > arg , da_len ) )
{
enum debug_info_type type = da - > debug_type ;
const char * p = arg + da_len ;
if ( * p & & ( * p < ' 0 ' | | * p > ' 9 ' ) )
continue ;
/* A debug flag without a level defaults to level 2.
Note we do not want to call read_integral_parameter
for that case since it will call atoi which
will return zero .
? ? ? We may want to generalize the interface to
read_integral_parameter to better handle this case
if this case shows up often . */
if ( * p )
level = read_integral_parameter ( p , 0 , max_debug_level + 1 ) ;
else
level = 2 ;
if ( da_len > 1 & & * p & & ! strncmp ( arg , " dwarf " , da_len ) )
{
error ( " use -gdwarf -g%d for DWARF v1, level %d " ,
level , level ) ;
if ( level = = 2 )
error ( " use -gdwarf-2 for DWARF v2 " ) ;
}
if ( level > max_debug_level )
{
warning ( " \
ignoring option ` % s ' due to invalid debug level specification " ,
arg - 2 ) ;
level = debug_info_level ;
}
if ( type = = NO_DEBUG )
{
type = PREFERRED_DEBUGGING_TYPE ;
if ( da_len > 1 & & strncmp ( arg , " gdb " , da_len ) = = 0 )
{
# if defined (DWARF2_DEBUGGING_INFO) && !defined (LINKER_DOES_NOT_WORK_WITH_DWARF2)
type = DWARF2_DEBUG ;
# else
# ifdef DBX_DEBUGGING_INFO
type = DBX_DEBUG ;
# endif
# endif
}
}
if ( type = = NO_DEBUG )
[multiple changes]
Fri Oct 29 15:25:07 1999 Arnaud Charlet <charlet@ACT-Europe.FR>
* gcov.c (DIR_SEPARATOR): Provide default.
(output_data): Add test for MS-DOS format absolute filename.
(fancy_abort): Correct program name.
(open_files): Open all files in binary mode.
* libgcc2.c (__bb_exit_func): Likewise.
* profile.c (init_branch_prob): Specify binary when opening files.
* flags.h (flag_unwind_tables): New decl.
* toplev.c (flag_unwind_table): New definition.
(f_options): Add -funwind-tables.
(decode_g_option): Clarify warning when unknown -g option is given.
(rest_of_compilation): If inside an inlined external function,
pretend we are just being declared.
* dwarf2out.c (dwarf2out_do_frame): Check -funwind_tables.
(dwarf2out_frame_finish): Likewise.
Fri Oct 29 06:32:44 1999 Geoffrey Keating <geoffk@cygnus.com>
* flow.c (propagate_block): When the last reference to a label
before an ADDR_VEC is deleted because the reference is a dead
store, delete the ADDR_VEC.
Fri Oct 29 07:44:26 1999 Vasco Pedro <vp@di.fct.unl.pt>
* fold-const.c (merge_ranges): In not in0, but in1, handle
upper bounds equal like subset case.
Thu Oct 28 19:22:24 1999 Douglas Rupp <rupp@gnat.com>
* dbxout.c (dbxout_parms): Generate a second stabs line for parameters
passed in a register but moved to the stack.
Thu Oct 28 19:12:57 1999 Sam Tardieu <tardieu@act-europe.fr>
* gcc.c (pass_exit_codes, greatest_status): New variables.
(struct option_map): Add entry for "--pass-exit-codes".
(execute): Update greatest_status if error.
(display_help): Add documentation for -pass-exit-codes.
(process_command): Handle -pass-exit-codes.
(main): Look at pass_exit_codes and greatest_status on call to exit.
Thu Oct 28 18:06:50 1999 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* reload.c (find_reloads): Refine test for no input reload
case to not includes reloads emitted after insn.
* function.c (find_temp_slots_from_address): Handle sum involving
a register that points to a temp slot.
(update_temp_slot_address): Make recursive call if both old and
new are PLUS with a common operand.
* calls.c (expand_call): Mark temp slot for result as having
address taken.
* rtlanal.c (reg_referenced_p, case IF_THEN_ELSE): New case.
* gcc.c (process_command): Add standard_exec_prefix with "GCC"
component as well as "BINUTILS".
* integrate.h (copy_rtx_and_substitute): New arg, FOR_LHS.
* integrate.c (copy_rtx_and_substitute): Likewise.
(expand_inline_function, integrate_parm_decls, integrate_decl_tree):
All callers changed.
* unroll.c (inital_reg_note_copy, copy_loop_body): Likewise.
* dbxout.c (dbxout_type, case INTEGER_TYPE_NODE): If can use
gdb extensions, write size of type; also be more consistent
in using references when this is a subtype.
* pa.md (extv, extzv, insv): Use define_expand to reject constant
that is out of range.
* loop.c (unknown_constant_address_altered): New variable.
(prescan_loop): Initialize it.
(note_addr_stored): Set it for RTX_UNCHANGING_P MEM.
(invariant_p, case MEM): Remove handling for volatile and readony;
check new variable if readonly.
(check_dbra_loop): Chdeck unknown_constant_address_altered.
* cse.c (canon_hash, case MEM): Do not record if BLKmode.
(addr_affects_sp_p): Removed from note_mem_written and only
define #ifdef AUTO_INC_DEC.
* alpha.c (input_operand, case ADDRESSOF): Treat as REG.
* regclass.c (record_reg_classes): Properly handle register move
directions.
* varasm.c (initializer_constant_valid_p, case MINUS_EXPR):
Don't think valid if both operands are invalid.
(struct constant_descriptor): New field RTL.
(mark_const_hash_entry): Mark it.
(record_constant{,_rtx}): Initialize it.
(output_constant_def): Allocate RTL in permanent obstack and
save in table.
({record,compare}_constant_1): Modes must match for
CONSTRUCTOR of ARRAY_TYPE.
* c-common.h (initializer_constant_valid_p): Delete decl from here.
* output.h (initializer_constant_valid_p): Move decl to here.
* c-common.c (initializer_constant_valid_p): Delete function from here.
* varasm.c (initializer_constant_valid_p): Move function to here.
* tree.h (STRIP_SIGN_NOPS): New macro.
* fold-const.c (optimize_minmax_comparison): New function.
(invert_truthvalue, case WITH_RECORD_EXPR): New case.
(fold): Use STRIP_SIGN_NOPS instead of STRIP_TYPE_NOPS.
(fold, case EQ_EXPR): Call optimize_minmax_comparison and add
cases with ABS_EXPR, NEGATE_EXPR, PLUS_EXPR, MINUS_EXPR, and
widening conversions.
(fold, case LE_EXPR): Rework changing unsigned to signed comparisons
to look at size of mode, not precision of type; also add missing cases.
(optimize_bit_field_compare, decode_field_reference): Don't try to
optimize COMPONENT_REF of a PLACEHOLDER_EXPR.
* dwarf2out.c (ctype.h): Include.
(dwarf2out_set_demangle_name_func): New function.
(size_of_line_info): Deleted.
(output_line_info): Compute size of line info table from difference
of labels.
(base_type_die, add_name_attribute): Call demangle function, if any.
(field_byte_offset): Use bits per word for variable length fields.
(gen_array_type_die): Add array name.
(gen_subprogram_die): Ignore DECL_INLINE if -fno-inline.
(dwarf2out_add_library_unit_info): New function.
* explow.c (set_stack_check_libfunc): New function.
(stack_check_libfunc): New static variable.
(probe_stack_range): Allow front-end to set up a libfunc to call.
* combine.c (simplify_comparison): When making comparison in wider
mode, check for having commuted an AND and a SUBREG.
(contains_muldiv): New function.
(try_combine): Call it when dividing a PARALLEL.
(simplify_rtx, case TRUNCATE): Don't remove for umulsi3_highpart.
(simplify_comparison, case ASHIFTRT): Recognize sign-extension of
a PLUS.
(record_value_for_reg): If TEM is a binary operation with two CLOBBERs,
use one of the CLOBBERs instead.
(if_then_else_cond): If comparing against zero, just return thing
being compared.
* optabs.c (expand_abs): If machine has MAX, ABS (x) is MAX (x, -x).
Don't generate shifts and subtract if have conditional arithmetic.
* rtl.h (delete_barrier): New declaration.
* jump.c (jump_optimize): Set up to handle conditional call.
In conditional arithmetic case, handle CALL_INSN followed by a BARRIER.
(delete_barrier): New function.
* rtl.c (read_rtx): Call fatal if bad RTL code; check for bad mode.
* recog.c (nonmemory_operand): Accept ADDRESSOF.
* tree.c (build_type_attribute_variant): Push to obstack of
ttype around type_hash_canon call.
* expr.c (placeholder_list): Move decl to file scope.
(expand_expr): Don't force access to volatile just because its
address is taken.
If ignoring reference operations, just expand the operands.
(expand_expr, case COMPONENT_REF): Propagate
EXPAND_CONST_ADDRESS to recursive call when expanding inner.
Refine test for using bitfield operations vs pointer punning.
(expand_expr, case CONVERT_EXPR): If converting to
BLKmode UNION_TYPE from BLKmode, just return inner object.
Use proper mode in store_field call.
Properly set sizes of object to store and total size in store_field
call for convert to union.
(expand_expr, case ARRAY_REF): If OP0 is in a register, put it in
memory (like for ADDR_EXPR). Also, don't put constant in register if
we'll want it in memory.
(readonly_fields_p): New function.
(expand_expr, case INDIRECT_REF): Call it if LHS.
(expand_assignment): Handle a RESULT_DECL where
DECL_RTL is a PARALLEL.
(do_jump, case WITH_RECORD_EXPR): New case.
(get_inner_reference): Always go inside a CONVERT_EXPR
and NOP_EXPR if both modes are the same.
(store_field): Use bitfield operations if size of bitsize is not same
as size of RHS's type.
Check for bitpos not a multiple of alignment in BLKmode case.
Do block move in largest possible alignment.
(store_constructor): Set BITSIZE to -1 for variable size and properly
in case of array of BLKmode.
(expand_expr_unaligned): New function.
(do_compare_and_jump): Call it.
* mips/iris5.h (SWITCHES_NEED_SPACES): New macro.
* collect2.c (main): Only allow -ofoo if SWITCHES_NEED_SPACES
does not include 'o'.
* function.c (instantiate_virtual_regs_1, case SET): Handle case where
both SET_DEST and SET_SRC reference a virtual register.
(gen_mem_addressof): Copy RTX_UNCHANGING_P from new REG to old REG.
* integrate.c (expand_inline_function): Handle case of setting
virtual stack vars register (from built in setjmp); when parameter
lives in memory, expand virtual_{stack_vars,incoming_args}_rtx early.
(subst_constant): Add new parm, MEMONLY.
(expand_inline_function, integrate_parm_decls): Pass new parm.
(integrate_decl_tree): Likewise.
(copy_rtx_and_substitute, case MEM): Do copy RTX_UNCHANGING_P.
(try_constants): Call subst_constants twice, with MEMONLY 0 and 1.
(copy_rtx_and_substitute, case SET): Add explicit calls to
copy_rtx_and_substitute for both sides.
* stmt.c (expand_asm_operands): Don't use TREE_STRING_LENGTH for
constraints.
(pushcase{,_range}): Convert to NOMINAL_TYPE after checking for
within INDEX_TYPE, instead of before.
(fixup_gotos): Use f->target_rtl, not the next insn,
since latter may be from a later fixup.
(expand_value_return): Correctly convert VAL when promoting function
return; support RETURN_REG being a PARALLEL.
(expand_return): When checking for result in regs and having
cleanup, consider PARALLEL in DECL_RTL as being in regs.
From-SVN: r30299
1999-11-01 02:11:22 +01:00
warning ( " `%s': unknown or unsupported -g option " , arg - 2 ) ;
1999-09-20 15:48:12 +02:00
/* Does it conflict with an already selected type? */
if ( type_explicitly_set_p
/* -g/-ggdb don't conflict with anything */
& & da - > debug_type ! = NO_DEBUG
& & type ! = selected_debug_type )
warning ( " `%s' ignored, conflicts with `-g%s' " ,
arg - 2 , debug_type_names [ ( int ) selected_debug_type ] ) ;
else
{
/* If the format has already been set, -g/-ggdb
only change the debug level . */
if ( type_explicitly_set_p & & da - > debug_type = = NO_DEBUG )
; /* don't change debugging type */
else
{
selected_debug_type = type ;
type_explicitly_set_p = da - > debug_type ! = NO_DEBUG ;
}
write_symbols = ( level = = 0
? NO_DEBUG
: selected_debug_type ) ;
use_gnu_debug_info_extensions = da - > use_extensions_p ;
debug_info_level = ( enum debug_info_level ) level ;
}
break ;
}
}
1998-10-17 13:04:29 +02:00
1999-09-20 15:48:12 +02:00
if ( ! da - > arg )
[multiple changes]
Fri Oct 29 15:25:07 1999 Arnaud Charlet <charlet@ACT-Europe.FR>
* gcov.c (DIR_SEPARATOR): Provide default.
(output_data): Add test for MS-DOS format absolute filename.
(fancy_abort): Correct program name.
(open_files): Open all files in binary mode.
* libgcc2.c (__bb_exit_func): Likewise.
* profile.c (init_branch_prob): Specify binary when opening files.
* flags.h (flag_unwind_tables): New decl.
* toplev.c (flag_unwind_table): New definition.
(f_options): Add -funwind-tables.
(decode_g_option): Clarify warning when unknown -g option is given.
(rest_of_compilation): If inside an inlined external function,
pretend we are just being declared.
* dwarf2out.c (dwarf2out_do_frame): Check -funwind_tables.
(dwarf2out_frame_finish): Likewise.
Fri Oct 29 06:32:44 1999 Geoffrey Keating <geoffk@cygnus.com>
* flow.c (propagate_block): When the last reference to a label
before an ADDR_VEC is deleted because the reference is a dead
store, delete the ADDR_VEC.
Fri Oct 29 07:44:26 1999 Vasco Pedro <vp@di.fct.unl.pt>
* fold-const.c (merge_ranges): In not in0, but in1, handle
upper bounds equal like subset case.
Thu Oct 28 19:22:24 1999 Douglas Rupp <rupp@gnat.com>
* dbxout.c (dbxout_parms): Generate a second stabs line for parameters
passed in a register but moved to the stack.
Thu Oct 28 19:12:57 1999 Sam Tardieu <tardieu@act-europe.fr>
* gcc.c (pass_exit_codes, greatest_status): New variables.
(struct option_map): Add entry for "--pass-exit-codes".
(execute): Update greatest_status if error.
(display_help): Add documentation for -pass-exit-codes.
(process_command): Handle -pass-exit-codes.
(main): Look at pass_exit_codes and greatest_status on call to exit.
Thu Oct 28 18:06:50 1999 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* reload.c (find_reloads): Refine test for no input reload
case to not includes reloads emitted after insn.
* function.c (find_temp_slots_from_address): Handle sum involving
a register that points to a temp slot.
(update_temp_slot_address): Make recursive call if both old and
new are PLUS with a common operand.
* calls.c (expand_call): Mark temp slot for result as having
address taken.
* rtlanal.c (reg_referenced_p, case IF_THEN_ELSE): New case.
* gcc.c (process_command): Add standard_exec_prefix with "GCC"
component as well as "BINUTILS".
* integrate.h (copy_rtx_and_substitute): New arg, FOR_LHS.
* integrate.c (copy_rtx_and_substitute): Likewise.
(expand_inline_function, integrate_parm_decls, integrate_decl_tree):
All callers changed.
* unroll.c (inital_reg_note_copy, copy_loop_body): Likewise.
* dbxout.c (dbxout_type, case INTEGER_TYPE_NODE): If can use
gdb extensions, write size of type; also be more consistent
in using references when this is a subtype.
* pa.md (extv, extzv, insv): Use define_expand to reject constant
that is out of range.
* loop.c (unknown_constant_address_altered): New variable.
(prescan_loop): Initialize it.
(note_addr_stored): Set it for RTX_UNCHANGING_P MEM.
(invariant_p, case MEM): Remove handling for volatile and readony;
check new variable if readonly.
(check_dbra_loop): Chdeck unknown_constant_address_altered.
* cse.c (canon_hash, case MEM): Do not record if BLKmode.
(addr_affects_sp_p): Removed from note_mem_written and only
define #ifdef AUTO_INC_DEC.
* alpha.c (input_operand, case ADDRESSOF): Treat as REG.
* regclass.c (record_reg_classes): Properly handle register move
directions.
* varasm.c (initializer_constant_valid_p, case MINUS_EXPR):
Don't think valid if both operands are invalid.
(struct constant_descriptor): New field RTL.
(mark_const_hash_entry): Mark it.
(record_constant{,_rtx}): Initialize it.
(output_constant_def): Allocate RTL in permanent obstack and
save in table.
({record,compare}_constant_1): Modes must match for
CONSTRUCTOR of ARRAY_TYPE.
* c-common.h (initializer_constant_valid_p): Delete decl from here.
* output.h (initializer_constant_valid_p): Move decl to here.
* c-common.c (initializer_constant_valid_p): Delete function from here.
* varasm.c (initializer_constant_valid_p): Move function to here.
* tree.h (STRIP_SIGN_NOPS): New macro.
* fold-const.c (optimize_minmax_comparison): New function.
(invert_truthvalue, case WITH_RECORD_EXPR): New case.
(fold): Use STRIP_SIGN_NOPS instead of STRIP_TYPE_NOPS.
(fold, case EQ_EXPR): Call optimize_minmax_comparison and add
cases with ABS_EXPR, NEGATE_EXPR, PLUS_EXPR, MINUS_EXPR, and
widening conversions.
(fold, case LE_EXPR): Rework changing unsigned to signed comparisons
to look at size of mode, not precision of type; also add missing cases.
(optimize_bit_field_compare, decode_field_reference): Don't try to
optimize COMPONENT_REF of a PLACEHOLDER_EXPR.
* dwarf2out.c (ctype.h): Include.
(dwarf2out_set_demangle_name_func): New function.
(size_of_line_info): Deleted.
(output_line_info): Compute size of line info table from difference
of labels.
(base_type_die, add_name_attribute): Call demangle function, if any.
(field_byte_offset): Use bits per word for variable length fields.
(gen_array_type_die): Add array name.
(gen_subprogram_die): Ignore DECL_INLINE if -fno-inline.
(dwarf2out_add_library_unit_info): New function.
* explow.c (set_stack_check_libfunc): New function.
(stack_check_libfunc): New static variable.
(probe_stack_range): Allow front-end to set up a libfunc to call.
* combine.c (simplify_comparison): When making comparison in wider
mode, check for having commuted an AND and a SUBREG.
(contains_muldiv): New function.
(try_combine): Call it when dividing a PARALLEL.
(simplify_rtx, case TRUNCATE): Don't remove for umulsi3_highpart.
(simplify_comparison, case ASHIFTRT): Recognize sign-extension of
a PLUS.
(record_value_for_reg): If TEM is a binary operation with two CLOBBERs,
use one of the CLOBBERs instead.
(if_then_else_cond): If comparing against zero, just return thing
being compared.
* optabs.c (expand_abs): If machine has MAX, ABS (x) is MAX (x, -x).
Don't generate shifts and subtract if have conditional arithmetic.
* rtl.h (delete_barrier): New declaration.
* jump.c (jump_optimize): Set up to handle conditional call.
In conditional arithmetic case, handle CALL_INSN followed by a BARRIER.
(delete_barrier): New function.
* rtl.c (read_rtx): Call fatal if bad RTL code; check for bad mode.
* recog.c (nonmemory_operand): Accept ADDRESSOF.
* tree.c (build_type_attribute_variant): Push to obstack of
ttype around type_hash_canon call.
* expr.c (placeholder_list): Move decl to file scope.
(expand_expr): Don't force access to volatile just because its
address is taken.
If ignoring reference operations, just expand the operands.
(expand_expr, case COMPONENT_REF): Propagate
EXPAND_CONST_ADDRESS to recursive call when expanding inner.
Refine test for using bitfield operations vs pointer punning.
(expand_expr, case CONVERT_EXPR): If converting to
BLKmode UNION_TYPE from BLKmode, just return inner object.
Use proper mode in store_field call.
Properly set sizes of object to store and total size in store_field
call for convert to union.
(expand_expr, case ARRAY_REF): If OP0 is in a register, put it in
memory (like for ADDR_EXPR). Also, don't put constant in register if
we'll want it in memory.
(readonly_fields_p): New function.
(expand_expr, case INDIRECT_REF): Call it if LHS.
(expand_assignment): Handle a RESULT_DECL where
DECL_RTL is a PARALLEL.
(do_jump, case WITH_RECORD_EXPR): New case.
(get_inner_reference): Always go inside a CONVERT_EXPR
and NOP_EXPR if both modes are the same.
(store_field): Use bitfield operations if size of bitsize is not same
as size of RHS's type.
Check for bitpos not a multiple of alignment in BLKmode case.
Do block move in largest possible alignment.
(store_constructor): Set BITSIZE to -1 for variable size and properly
in case of array of BLKmode.
(expand_expr_unaligned): New function.
(do_compare_and_jump): Call it.
* mips/iris5.h (SWITCHES_NEED_SPACES): New macro.
* collect2.c (main): Only allow -ofoo if SWITCHES_NEED_SPACES
does not include 'o'.
* function.c (instantiate_virtual_regs_1, case SET): Handle case where
both SET_DEST and SET_SRC reference a virtual register.
(gen_mem_addressof): Copy RTX_UNCHANGING_P from new REG to old REG.
* integrate.c (expand_inline_function): Handle case of setting
virtual stack vars register (from built in setjmp); when parameter
lives in memory, expand virtual_{stack_vars,incoming_args}_rtx early.
(subst_constant): Add new parm, MEMONLY.
(expand_inline_function, integrate_parm_decls): Pass new parm.
(integrate_decl_tree): Likewise.
(copy_rtx_and_substitute, case MEM): Do copy RTX_UNCHANGING_P.
(try_constants): Call subst_constants twice, with MEMONLY 0 and 1.
(copy_rtx_and_substitute, case SET): Add explicit calls to
copy_rtx_and_substitute for both sides.
* stmt.c (expand_asm_operands): Don't use TREE_STRING_LENGTH for
constraints.
(pushcase{,_range}): Convert to NOMINAL_TYPE after checking for
within INDEX_TYPE, instead of before.
(fixup_gotos): Use f->target_rtl, not the next insn,
since latter may be from a later fixup.
(expand_value_return): Correctly convert VAL when promoting function
return; support RETURN_REG being a PARALLEL.
(expand_return): When checking for result in regs and having
cleanup, consider PARALLEL in DECL_RTL as being in regs.
From-SVN: r30299
1999-11-01 02:11:22 +01:00
warning ( " `%s': unknown or unsupported -g option " , arg - 2 ) ;
1999-09-20 15:48:12 +02:00
return 1 ;
}
/* Decode the first argument in the argv as a language-independent option.
Return the number of strings consumed . ' strings_processed ' is the
number of strings that have already been decoded in a language
specific fashion before this function was invoked . */
static unsigned
independent_decode_option ( argc , argv , strings_processed )
int argc ;
char * * argv ;
unsigned strings_processed ATTRIBUTE_UNUSED ;
{
char * arg = argv [ 0 ] ;
1998-10-17 13:04:29 +02:00
1999-09-20 15:48:12 +02:00
if ( arg [ 0 ] ! = ' - ' | | arg [ 1 ] = = 0 )
1998-07-13 19:20:29 +02:00
{
1999-09-20 15:48:12 +02:00
if ( arg [ 0 ] = = ' + ' )
return 0 ;
filename = arg ;
return 1 ;
1998-07-13 19:20:29 +02:00
}
1999-09-20 15:48:12 +02:00
arg + + ;
1998-10-17 13:04:29 +02:00
1999-09-20 15:48:12 +02:00
if ( ! strcmp ( arg , " -help " ) )
{
display_help ( ) ;
exit ( 0 ) ;
}
if ( * arg = = ' Y ' )
arg + + ;
1998-10-17 13:04:29 +02:00
1999-09-20 15:48:12 +02:00
switch ( * arg )
1998-07-13 19:20:29 +02:00
{
1999-09-20 15:48:12 +02:00
default :
return 0 ;
case ' O ' :
/* Already been treated in main (). Do nothing. */
break ;
case ' m ' :
set_target_switch ( arg + 1 ) ;
break ;
case ' f ' :
return decode_f_option ( arg + 1 ) ;
case ' g ' :
return decode_g_option ( arg + 1 ) ;
case ' d ' :
if ( ! strcmp ( arg , " dumpbase " ) )
{
if ( argc = = 1 )
return 0 ;
dump_base_name = argv [ 1 ] ;
return 2 ;
}
else
decode_d_option ( arg + 1 ) ;
break ;
case ' p ' :
if ( ! strcmp ( arg , " pedantic " ) )
pedantic = 1 ;
else if ( ! strcmp ( arg , " pedantic-errors " ) )
flag_pedantic_errors = pedantic = 1 ;
else if ( arg [ 1 ] = = 0 )
profile_flag = 1 ;
else
return 0 ;
break ;
case ' q ' :
if ( ! strcmp ( arg , " quiet " ) )
quiet_flag = 1 ;
else
return 0 ;
break ;
case ' v ' :
if ( ! strcmp ( arg , " version " ) )
version_flag = 1 ;
else
return 0 ;
break ;
case ' w ' :
if ( arg [ 1 ] = = 0 )
inhibit_warnings = 1 ;
else
return 0 ;
break ;
case ' W ' :
if ( arg [ 1 ] = = 0 )
{
extra_warnings = 1 ;
/* We save the value of warn_uninitialized, since if they put
- Wuninitialized on the command line , we need to generate a
warning about not using it without also specifying - O . */
if ( warn_uninitialized ! = 1 )
warn_uninitialized = 2 ;
}
else
return decode_W_option ( arg + 1 ) ;
break ;
case ' a ' :
if ( arg [ 1 ] = = 0 )
{
# if !defined (BLOCK_PROFILER) || !defined (FUNCTION_BLOCK_PROFILER)
warning ( " `-a' option (basic block profile) not supported " ) ;
# else
profile_block_flag = ( profile_block_flag < 2 ) ? 1 : 3 ;
# endif
}
else if ( ! strcmp ( arg , " ax " ) )
1998-07-13 19:20:29 +02:00
{
1999-09-20 15:48:12 +02:00
# if !defined (FUNCTION_BLOCK_PROFILER_EXIT) || !defined (BLOCK_PROFILER) || !defined (FUNCTION_BLOCK_PROFILER)
warning ( " `-ax' option (jump profiling) not supported " ) ;
# else
profile_block_flag = ( ! profile_block_flag
| | profile_block_flag = = 2 ) ? 2 : 3 ;
# endif
}
else if ( ! strncmp ( arg , " aux-info " , 8 ) )
{
flag_gen_aux_info = 1 ;
if ( arg [ 8 ] = = ' \0 ' )
{
if ( argc = = 1 )
return 0 ;
aux_info_file_name = argv [ 1 ] ;
return 2 ;
}
else
aux_info_file_name = arg + 8 ;
}
else
return 0 ;
break ;
case ' o ' :
if ( arg [ 1 ] = = 0 )
{
if ( argc = = 1 )
return 0 ;
1998-10-17 13:04:29 +02:00
1999-09-20 15:48:12 +02:00
asm_file_name = argv [ 1 ] ;
return 2 ;
1998-07-13 19:20:29 +02:00
}
1999-09-20 15:48:12 +02:00
return 0 ;
case ' G ' :
{
int g_switch_val ;
int return_val ;
if ( arg [ 1 ] = = 0 )
{
if ( argc = = 1 )
return 0 ;
g_switch_val = read_integral_parameter ( argv [ 1 ] , 0 , - 1 ) ;
return_val = 2 ;
}
else
{
g_switch_val = read_integral_parameter ( arg + 1 , 0 , - 1 ) ;
return_val = 1 ;
}
if ( g_switch_val = = - 1 )
return_val = 0 ;
else
{
g_switch_set = TRUE ;
g_switch_value = g_switch_val ;
}
return return_val ;
}
1998-07-13 19:20:29 +02:00
}
1998-10-17 13:04:29 +02:00
1998-07-13 19:20:29 +02:00
return 1 ;
}
1992-02-06 00:20:23 +01:00
/* Entry point of cc1/c++. Decode command args, then call compile_file.
Exit code is 35 if can ' t open files , 34 if fatal error ,
33 if had nonfatal errors , else success . */
2000-01-17 16:55:18 +01:00
extern int main PARAMS ( ( int , char * * ) ) ;
rtl.h (get_insn_name, [...]): Add prototypes.
* rtl.h (get_insn_name, print_rtl_with_bb): Add prototypes.
* print-rtl.c (get_insn_name): Remove prototype.
* toplev.h (progname): Declare const.
* toplev.c (init_decl_processing, init_obstacks, init_tree_codes,
init_regs, init_optabs, init_stmt, init_reg_sets, dump_flow_info,
dump_sched_info, dump_local_alloc, regset_release_memory,
print_rtl, print_rtl_with_bb, rest_of_decl_compilation,
error_with_file_and_line, error_with_decl, error_for_asm, error,
fatal, warning_with_file_and_line, warning_with_decl, warning,
pedwarn, pedwarn_with_decl, pedwarn_with_file_and_line, sorry):
Remove redundant prototypes.
(notice, check_lang_option, report_file_and_line, vnotice,
mark_file_stack): Add static prototype.
(set_fatal_function): Add prototype.
(vnotice, report_file_and_line, set_fatal_function,
check_lang_option): Constify a char*.
(main): Prototype. Call return, not exit.
cp:
* typeck2.c (ack): Don't declare progname.
From-SVN: r29433
1999-09-15 16:04:10 +02:00
1992-02-06 00:20:23 +01:00
int
Makefile.in (toplev.o): Depend on $(EXPR_H).
* Makefile.in (toplev.o): Depend on $(EXPR_H).
(insn-extract.o, insn-attrtab.o): Depend on toplev.h.
* gansidecl.h: Define ATTRIBUTE_NORETURN.
* genattrtab.c: Have insn-attrtab.c include toplev.h.
* genextract.c: Have insn-extract.c include toplev.h.
* rtl.h: Don't prototype `fatal_insn_not_found' and `fatal_insn'.
* toplev.c: Include expr.h.
(really_sorry, fancy_abort): Remove prototypes.
(set_target_switch): Add argument in prototype.
(vfatal): Mark prototype with ATTRIBUTE_NORETURN.
(v_really_sorry): Likewise.
(print_version, print_single_switch, print_switch_values): Make
static and add prototype arguments.
(decl_printable_name): Add prototype arguments.
(lang_expand_expr_t): New typedef.
(lang_expand_expr): Declare as a lang_expand_expr_t.
(incomplete_decl_finalize_hook): Add prototype argument.
(decl_name): Mark variable `verbosity' with ATTRIBUTE_UNUSED.
(botch): Likewise for variable `s'.
(rest_of_type_compilation): Mark variables `type' and `toplev'
with ATTRIBUTE_UNUSED if none of DBX_DEBUGGING_INFO,
XCOFF_DEBUGGING_INFO or SDB_DEBUGGING_INFO are defined.
(display_help): Make variable `i' an `unsigned long'.
(main): Remove unused parameter `envp'.
Cast assignment to `lang_expand_expr' to a `lang_expand_expr_t'.
Cast -1 when comparing it with a `size_t'.
* toplev.h (fatal, fatal_io_error, pfatal_with_name): Mark
prototype with ATTRIBUTE_NORETURN.
(fatal_insn_not_found, fatal_insn, really_sorry,
push_float_handler, pop_float_handler): Add prototypes.
(fancy_abort): Mark prototype with ATTRIBUTE_NORETURN.
(do_abort, botch): Add prototypes.
From-SVN: r22293
1998-09-06 07:56:20 +02:00
main ( argc , argv )
1992-02-06 00:20:23 +01:00
int argc ;
char * * argv ;
{
register int i ;
char * p ;
/* save in case md file wants to emit args as a comment. */
save_argc = argc ;
save_argv = argv ;
p = argv [ 0 ] + strlen ( argv [ 0 ] ) ;
1995-02-13 12:50:13 +01:00
while ( p ! = argv [ 0 ] & & p [ - 1 ] ! = ' / '
# ifdef DIR_SEPARATOR
& & p [ - 1 ] ! = DIR_SEPARATOR
# endif
)
- - p ;
1992-02-06 00:20:23 +01:00
progname = p ;
1999-01-30 15:34:11 +01:00
# ifdef HAVE_LC_MESSAGES
1999-01-27 02:43:17 +01:00
setlocale ( LC_MESSAGES , " " ) ;
1999-01-30 15:34:11 +01:00
# endif
1999-03-18 08:29:10 +01:00
( void ) bindtextdomain ( PACKAGE , localedir ) ;
( void ) textdomain ( PACKAGE ) ;
1999-01-27 02:43:17 +01:00
1992-02-06 00:20:23 +01:00
signal ( SIGFPE , float_signal ) ;
1993-04-13 23:21:50 +02:00
# ifdef SIGPIPE
1992-02-06 00:20:23 +01:00
signal ( SIGPIPE , pipe_closed ) ;
1993-04-13 23:21:50 +02:00
# endif
1992-02-06 00:20:23 +01:00
decl_printable_name = decl_name ;
Makefile.in (toplev.o): Depend on $(EXPR_H).
* Makefile.in (toplev.o): Depend on $(EXPR_H).
(insn-extract.o, insn-attrtab.o): Depend on toplev.h.
* gansidecl.h: Define ATTRIBUTE_NORETURN.
* genattrtab.c: Have insn-attrtab.c include toplev.h.
* genextract.c: Have insn-extract.c include toplev.h.
* rtl.h: Don't prototype `fatal_insn_not_found' and `fatal_insn'.
* toplev.c: Include expr.h.
(really_sorry, fancy_abort): Remove prototypes.
(set_target_switch): Add argument in prototype.
(vfatal): Mark prototype with ATTRIBUTE_NORETURN.
(v_really_sorry): Likewise.
(print_version, print_single_switch, print_switch_values): Make
static and add prototype arguments.
(decl_printable_name): Add prototype arguments.
(lang_expand_expr_t): New typedef.
(lang_expand_expr): Declare as a lang_expand_expr_t.
(incomplete_decl_finalize_hook): Add prototype argument.
(decl_name): Mark variable `verbosity' with ATTRIBUTE_UNUSED.
(botch): Likewise for variable `s'.
(rest_of_type_compilation): Mark variables `type' and `toplev'
with ATTRIBUTE_UNUSED if none of DBX_DEBUGGING_INFO,
XCOFF_DEBUGGING_INFO or SDB_DEBUGGING_INFO are defined.
(display_help): Make variable `i' an `unsigned long'.
(main): Remove unused parameter `envp'.
Cast assignment to `lang_expand_expr' to a `lang_expand_expr_t'.
Cast -1 when comparing it with a `size_t'.
* toplev.h (fatal, fatal_io_error, pfatal_with_name): Mark
prototype with ATTRIBUTE_NORETURN.
(fatal_insn_not_found, fatal_insn, really_sorry,
push_float_handler, pop_float_handler): Add prototypes.
(fancy_abort): Mark prototype with ATTRIBUTE_NORETURN.
(do_abort, botch): Add prototypes.
From-SVN: r22293
1998-09-06 07:56:20 +02:00
lang_expand_expr = ( lang_expand_expr_t ) do_abort ;
1992-02-06 00:20:23 +01:00
/* Initialize whether `char' is signed. */
flag_signed_char = DEFAULT_SIGNED_CHAR ;
# ifdef DEFAULT_SHORT_ENUMS
/* Initialize how much space enums occupy, by default. */
flag_short_enums = DEFAULT_SHORT_ENUMS ;
# endif
1999-09-07 17:20:58 +02:00
/* Initialize the garbage-collector. */
1999-09-09 10:56:16 +02:00
init_ggc ( ) ;
1999-09-07 12:10:01 +02:00
ggc_add_root ( & input_file_stack , 1 , sizeof input_file_stack ,
2000-01-05 07:55:02 +01:00
mark_file_stack ) ;
1999-12-04 04:00:04 +01:00
ggc_add_rtx_root ( & stack_limit_rtx , 1 ) ;
1999-09-07 12:10:01 +02:00
1998-06-07 16:06:47 +02:00
/* Perform language-specific options intialization. */
lang_init_options ( ) ;
1992-02-06 00:20:23 +01:00
/* Scan to see what optimization level has been specified. That will
determine the default value of many flags . */
for ( i = 1 ; i < argc ; i + + )
{
if ( ! strcmp ( argv [ i ] , " -O " ) )
{
optimize = 1 ;
1998-12-16 18:34:48 +01:00
optimize_size = 0 ;
1992-02-06 00:20:23 +01:00
}
else if ( argv [ i ] [ 0 ] = = ' - ' & & argv [ i ] [ 1 ] = = ' O ' )
{
1998-01-27 00:00:04 +01:00
/* Handle -Os, -O2, -O3, -O69, ... */
1992-02-06 00:20:23 +01:00
char * p = & argv [ i ] [ 2 ] ;
1998-01-27 00:00:04 +01:00
if ( ( p [ 0 ] = = ' s ' ) & & ( p [ 1 ] = = 0 ) )
1998-12-16 18:34:48 +01:00
{
optimize_size = 1 ;
/* Optimizing for size forces optimize to be 2. */
optimize = 2 ;
}
1998-01-27 00:00:04 +01:00
else
{
1999-03-19 02:01:01 +01:00
const int optimize_val = read_integral_parameter ( p , p - 2 , - 1 ) ;
if ( optimize_val ! = - 1 )
1998-12-16 18:34:48 +01:00
{
1999-03-19 02:01:01 +01:00
optimize = optimize_val ;
1998-12-16 18:34:48 +01:00
optimize_size = 0 ;
}
1998-01-27 00:00:04 +01:00
}
1992-02-06 00:20:23 +01:00
}
}
obey_regdecls = ( optimize = = 0 ) ;
if ( optimize > = 1 )
{
1993-05-05 17:36:05 +02:00
flag_defer_pop = 1 ;
1992-02-06 00:20:23 +01:00
flag_thread_jumps = 1 ;
# ifdef DELAY_SLOTS
flag_delayed_branch = 1 ;
1993-12-31 12:56:39 +01:00
# endif
# ifdef CAN_DEBUG_WITHOUT_FP
flag_omit_frame_pointer = 1 ;
1992-02-06 00:20:23 +01:00
# endif
}
if ( optimize > = 2 )
{
flag_cse_follow_jumps = 1 ;
1992-04-05 18:34:53 +02:00
flag_cse_skip_blocks = 1 ;
1998-05-20 02:24:32 +02:00
flag_gcse = 1 ;
1992-02-06 00:20:23 +01:00
flag_expensive_optimizations = 1 ;
flag_strength_reduce = 1 ;
flag_rerun_cse_after_loop = 1 ;
1997-10-26 17:56:15 +01:00
flag_rerun_loop_opt = 1 ;
1992-03-07 00:26:22 +01:00
flag_caller_saves = 1 ;
1995-04-21 14:08:07 +02:00
flag_force_mem = 1 ;
1999-08-31 22:37:09 +02:00
flag_peephole2 = 1 ;
1992-02-06 00:20:23 +01:00
# ifdef INSN_SCHEDULING
flag_schedule_insns = 1 ;
flag_schedule_insns_after_reload = 1 ;
# endif
1997-08-12 06:07:19 +02:00
flag_regmove = 1 ;
1998-08-17 10:18:17 +02:00
flag_strict_aliasing = 1 ;
1999-09-23 21:57:50 +02:00
flag_delete_null_pointer_checks = 1 ;
1992-02-06 00:20:23 +01:00
}
1993-12-31 12:56:39 +01:00
if ( optimize > = 3 )
{
flag_inline_functions = 1 ;
}
flags.h: New variables align_loops...
* flags.h: New variables align_loops, align_loops_log,
align_jumps, align_jumps_log, align_labels, align_labels_log,
align_functions, align_functions_log.
* toplev.c: Define them.
(f_options): Handle -falign-* when they have no argument.
(main): Add logic to set variables for -falign-functions,
-falign-jumps, -falign-labels, -falign-loops.
Make it -fsched-verbose=<n> and -finline-limit=<n>.
(display_help): Change help to match options.
* final.c (LABEL_ALIGN): Default to align_labels_log.
(LABEL_ALIGN_MAX_SKIP): Default to align_labels-1.
(LOOP_ALIGN): Default to align_loops_log.
(LOOP_ALIGN_MAX_SKIP): Default to align_loops-1.
(LABEL_ALIGN_AFTER_BARRIER): Default to align_jumps_log.
(LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP): Default to align_jumps-1.
* varasm.c (assemble_start_function): Handle align_functions.
* config/sparc/sparc.h: Don't declare sparc_align_*.
Don't provide LABEL_ALIGN_AFTER_BARRIER or LOOP_ALIGN.
(DEFAULT_SPARC_ALIGN_FUNCS): Delete; take functionality into
sparc.c.
(FUNCTION_BOUNDARY): Fix incorrect use---it's not just a request,
it's a promise.
* config/sparc/sparc.c: Delete sparc_align_loops,
sparc_align_jumps, sparc_align_funcs and the corresponding string
variables.
(sparc_override_options): Default align_functions on ultrasparc.
Delete -malign-* handling.
* config/mips/mips.c (override_options): On 64-bit targets,
try to align code to 64-bit boundaries.
(print_operand): New substitution, %~,
which aligns labels to align_labels_log.
* config/mips/mips.md (div_trap_normal): Use %~.
(div_trap_mips16): Likewise.
(abssi): Likewise.
(absdi2): Likewise.
(ffssi2): Likewise.
(ffsdi2): Likewise.
(ashldi3_internal): Likewise.
(ashrdi3_internal): Likewise.
(lshrdi3_internal): Likewise.
(casesi_internal): Likewise.
Plus corresponding documentation changes.
From-SVN: r29045
1999-09-02 07:42:06 +02:00
if ( optimize < 2 | | optimize_size )
{
align_loops = 1 ;
align_jumps = 1 ;
align_labels = 1 ;
align_functions = 1 ;
}
1995-11-29 23:57:03 +01:00
/* Initialize target_flags before OPTIMIZATION_OPTIONS so the latter can
modify it . */
target_flags = 0 ;
set_target_switch ( " " ) ;
1992-02-06 00:20:23 +01:00
# ifdef OPTIMIZATION_OPTIONS
/* Allow default optimizations to be specified on a per-machine basis. */
1998-01-27 00:00:04 +01:00
OPTIMIZATION_OPTIONS ( optimize , optimize_size ) ;
1992-02-06 00:20:23 +01:00
# endif
/* Initialize register usage now so switches may override. */
init_reg_sets ( ) ;
1999-09-20 15:48:12 +02:00
/* Perform normal command line switch decoding. */
for ( i = 1 ; i < argc ; )
1992-02-06 00:20:23 +01:00
{
1999-09-20 15:48:12 +02:00
unsigned lang_processed ;
unsigned indep_processed ;
1999-10-15 00:35:27 +02:00
1999-09-20 15:48:12 +02:00
/* Give the language a chance to decode the option for itself. */
lang_processed = lang_decode_option ( argc - i , argv + i ) ;
1999-10-15 02:05:52 +02:00
1999-09-20 15:48:12 +02:00
/* Now see if the option also has a language independent meaning.
Some options are both language specific and language independent ,
eg - - help . It is possible that there might be options that should
only be decoded in a language independent way if the were not
decoded in a langauge specific way , which is why ' lang_processed '
is passed in . */
1999-10-15 00:22:32 +02:00
indep_processed = independent_decode_option ( argc - i , argv + i ,
lang_processed ) ;
1999-09-20 15:48:12 +02:00
if ( lang_processed | | indep_processed )
1999-10-15 00:22:32 +02:00
i + = ( lang_processed > indep_processed
? lang_processed : indep_processed ) ;
1999-09-20 15:48:12 +02:00
else
1999-10-15 02:05:52 +02:00
{
1999-10-19 15:02:39 +02:00
const char * option = NULL ;
const char * lang = NULL ;
unsigned int j ;
/* It is possible that the command line switch is not valid for the
current language , but it is valid for another language . In order
to be compatible with previous versions of the compiler ( which
did not issue an error message in this case ) we check for this
possibilty here . If we do find a match , then if extra_warnings
is set we generate a warning message , otherwise we will just
ignore the option . */
for ( j = 0 ; j < NUM_ELEM ( documented_lang_options ) ; j + + )
{
option = documented_lang_options [ j ] . option ;
if ( option = = NULL )
lang = documented_lang_options [ j ] . description ;
else if ( ! strncmp ( argv [ i ] , option , strlen ( option ) ) )
break ;
}
1999-11-18 12:01:34 +01:00
if ( j ! = NUM_ELEM ( documented_lang_options ) )
1999-10-19 15:02:39 +02:00
{
if ( extra_warnings )
{
warning ( " Ignoring command line option '%s' " , argv [ i ] ) ;
if ( lang )
warning ( " \
( It is valid for % s but not the selected langauge ) " , lang);
}
}
else
error ( " Unrecognised option `%s' " , argv [ i ] ) ;
1999-10-15 02:05:52 +02:00
i + + ;
}
1992-02-06 00:20:23 +01:00
}
1997-08-02 19:20:21 +02:00
/* Checker uses the frame pointer. */
if ( flag_check_memory_usage )
flag_omit_frame_pointer = 0 ;
1992-03-23 20:29:32 +01:00
if ( optimize = = 0 )
{
1993-01-15 01:35:00 +01:00
/* Inlining does not work if not optimizing,
so force it not to be done . */
1992-03-23 20:29:32 +01:00
flag_no_inline = 1 ;
warn_inline = 0 ;
1993-01-15 01:35:00 +01:00
/* The c_decode_option and lang_decode_option functions set
this to ` 2 ' if - Wall is used , so we can avoid giving out
lots of errors for people who don ' t realize what - Wall does . */
if ( warn_uninitialized = = 1 )
warning ( " -Wuninitialized is not supported without -O " ) ;
1992-03-23 20:29:32 +01:00
}
1992-02-06 00:20:23 +01:00
# ifdef OVERRIDE_OPTIONS
/* Some machines may reject certain combinations of options. */
OVERRIDE_OPTIONS ;
# endif
1997-10-18 23:10:32 +02:00
if ( exceptions_via_longjmp = = 2 )
{
# ifdef DWARF2_UNWIND_INFO
exceptions_via_longjmp = ! DWARF2_UNWIND_INFO ;
# else
exceptions_via_longjmp = 1 ;
# endif
}
flags.h: New variables align_loops...
* flags.h: New variables align_loops, align_loops_log,
align_jumps, align_jumps_log, align_labels, align_labels_log,
align_functions, align_functions_log.
* toplev.c: Define them.
(f_options): Handle -falign-* when they have no argument.
(main): Add logic to set variables for -falign-functions,
-falign-jumps, -falign-labels, -falign-loops.
Make it -fsched-verbose=<n> and -finline-limit=<n>.
(display_help): Change help to match options.
* final.c (LABEL_ALIGN): Default to align_labels_log.
(LABEL_ALIGN_MAX_SKIP): Default to align_labels-1.
(LOOP_ALIGN): Default to align_loops_log.
(LOOP_ALIGN_MAX_SKIP): Default to align_loops-1.
(LABEL_ALIGN_AFTER_BARRIER): Default to align_jumps_log.
(LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP): Default to align_jumps-1.
* varasm.c (assemble_start_function): Handle align_functions.
* config/sparc/sparc.h: Don't declare sparc_align_*.
Don't provide LABEL_ALIGN_AFTER_BARRIER or LOOP_ALIGN.
(DEFAULT_SPARC_ALIGN_FUNCS): Delete; take functionality into
sparc.c.
(FUNCTION_BOUNDARY): Fix incorrect use---it's not just a request,
it's a promise.
* config/sparc/sparc.c: Delete sparc_align_loops,
sparc_align_jumps, sparc_align_funcs and the corresponding string
variables.
(sparc_override_options): Default align_functions on ultrasparc.
Delete -malign-* handling.
* config/mips/mips.c (override_options): On 64-bit targets,
try to align code to 64-bit boundaries.
(print_operand): New substitution, %~,
which aligns labels to align_labels_log.
* config/mips/mips.md (div_trap_normal): Use %~.
(div_trap_mips16): Likewise.
(abssi): Likewise.
(absdi2): Likewise.
(ffssi2): Likewise.
(ffsdi2): Likewise.
(ashldi3_internal): Likewise.
(ashrdi3_internal): Likewise.
(lshrdi3_internal): Likewise.
(casesi_internal): Likewise.
Plus corresponding documentation changes.
From-SVN: r29045
1999-09-02 07:42:06 +02:00
/* Set up the align_*_log variables, defaulting them to 1 if they
were still unset . */
if ( align_loops < = 0 ) align_loops = 1 ;
align_loops_log = floor_log2 ( align_loops * 2 - 1 ) ;
if ( align_jumps < = 0 ) align_jumps = 1 ;
align_jumps_log = floor_log2 ( align_jumps * 2 - 1 ) ;
if ( align_labels < = 0 ) align_labels = 1 ;
align_labels_log = floor_log2 ( align_labels * 2 - 1 ) ;
if ( align_functions < = 0 ) align_functions = 1 ;
align_functions_log = floor_log2 ( align_functions * 2 - 1 ) ;
1995-12-24 23:41:11 +01:00
if ( profile_block_flag = = 3 )
{
warning ( " `-ax' and `-a' are conflicting options. `-a' ignored. " ) ;
profile_block_flag = 2 ;
}
1992-02-06 00:20:23 +01:00
/* Unrolling all loops implies that standard loop unrolling must also
be done . */
if ( flag_unroll_all_loops )
flag_unroll_loops = 1 ;
/* Loop unrolling requires that strength_reduction be on also. Silently
turn on strength reduction here if it isn ' t already on . Also , the loop
unrolling code assumes that cse will be run after loop , so that must
be turned on also . */
if ( flag_unroll_loops )
{
flag_strength_reduce = 1 ;
flag_rerun_cse_after_loop = 1 ;
}
/* Warn about options that are not supported on this machine. */
# ifndef INSN_SCHEDULING
if ( flag_schedule_insns | | flag_schedule_insns_after_reload )
warning ( " instruction scheduling not supported on this target machine " ) ;
# endif
# ifndef DELAY_SLOTS
if ( flag_delayed_branch )
warning ( " this target machine does not have delayed branches " ) ;
# endif
1998-10-28 23:31:06 +01:00
user_label_prefix = USER_LABEL_PREFIX ;
if ( flag_leading_underscore ! = - 1 )
{
/* If the default prefix is more complicated than "" or "_",
issue a warning and ignore this option . */
if ( user_label_prefix [ 0 ] = = 0 | |
( user_label_prefix [ 0 ] = = ' _ ' & & user_label_prefix [ 1 ] = = 0 ) )
{
user_label_prefix = flag_leading_underscore ? " _ " : " " ;
}
else
warning ( " -f%sleading-underscore not supported on this target machine " ,
flag_leading_underscore ? " " : " no- " ) ;
}
1992-02-06 00:20:23 +01:00
/* If we are in verbose mode, write out the version and maybe all the
option flags in use . */
if ( version_flag )
{
1996-05-17 18:36:13 +02:00
print_version ( stderr , " " ) ;
1992-02-06 00:20:23 +01:00
if ( ! quiet_flag )
1996-05-17 18:36:13 +02:00
print_switch_values ( stderr , 0 , MAX_LINE , " " , " " , " \n " ) ;
1992-02-06 00:20:23 +01:00
}
compile_file ( filename ) ;
1999-03-23 00:23:26 +01:00
# if !defined(OS2) && !defined(VMS) && (!defined(_WIN32) || defined (__CYGWIN__)) && !defined(__INTERIX)
1992-02-06 00:20:23 +01:00
if ( flag_print_mem )
{
char * lim = ( char * ) sbrk ( 0 ) ;
toplev.c (notice, [...]): Move to diagnostic.c
1999-12-18 Gabriel Dos Reis <gdr@codesourcery.com>
* toplev.c (notice, vmessage, v_message_with_file_and_line,
v_message_with_decl, file_and_line_for_asm,
v_error_with_file_and_line, v_error_with_decl, v_error_for_asm,
verror, vfatal, v_warning_with_file_and_line, v_warning_with_decl,
v_warning_for_asm, vwarning, vpedwarn, v_pedwarn_with_decl,
v_pedwarn_with_file_and_line, vsorry, vnotice, count_error,
pfatal_with_name, fatal_io_error, need_error_newline,
last_error_function, last_error_tick, announce_function,
default_print_error_function, print_error_function,
report_error_function, fnotice, error_with_file_and_line,
error_with_decl, error_for_asm, error, set_fatal_function, fatal,
_fatal_insn, _fatal_insn_not_found, warning_with_file_and_line,
warning_with_decl, warning_for_asm, warning, pedwarn,
pedwarn_with_decl, pedwarn_with_file_and_line, sorry): Move to
diagnostic.c
(compile_file): Use fnotice instead of notice. Adjust call.
* diagnostic.c: New file.
* Makefile.in (OBJS): Include diagnostic.o
(diagnostic.o): Define dependence.
From-SVN: r31003
1999-12-18 02:45:40 +01:00
fnotice ( stderr , " Data size %ld. \n " , ( long ) ( lim - ( char * ) & environ ) ) ;
1992-02-06 00:20:23 +01:00
fflush ( stderr ) ;
1997-11-02 22:19:36 +01:00
# ifndef __MSDOS__
1992-02-06 00:20:23 +01:00
# ifdef USG
system ( " ps -l 1>&2 " ) ;
# else /* not USG */
system ( " ps v " ) ;
# endif /* not USG */
1997-11-02 22:19:36 +01:00
# endif
1992-02-06 00:20:23 +01:00
}
1999-03-23 00:23:26 +01:00
# endif /* ! OS2 && ! VMS && (! _WIN32 || CYGWIN) && ! __INTERIX */
1992-02-06 00:20:23 +01:00
if ( errorcount )
rtl.h (get_insn_name, [...]): Add prototypes.
* rtl.h (get_insn_name, print_rtl_with_bb): Add prototypes.
* print-rtl.c (get_insn_name): Remove prototype.
* toplev.h (progname): Declare const.
* toplev.c (init_decl_processing, init_obstacks, init_tree_codes,
init_regs, init_optabs, init_stmt, init_reg_sets, dump_flow_info,
dump_sched_info, dump_local_alloc, regset_release_memory,
print_rtl, print_rtl_with_bb, rest_of_decl_compilation,
error_with_file_and_line, error_with_decl, error_for_asm, error,
fatal, warning_with_file_and_line, warning_with_decl, warning,
pedwarn, pedwarn_with_decl, pedwarn_with_file_and_line, sorry):
Remove redundant prototypes.
(notice, check_lang_option, report_file_and_line, vnotice,
mark_file_stack): Add static prototype.
(set_fatal_function): Add prototype.
(vnotice, report_file_and_line, set_fatal_function,
check_lang_option): Constify a char*.
(main): Prototype. Call return, not exit.
cp:
* typeck2.c (ack): Don't declare progname.
From-SVN: r29433
1999-09-15 16:04:10 +02:00
return ( FATAL_EXIT_CODE ) ;
1992-02-06 00:20:23 +01:00
if ( sorrycount )
rtl.h (get_insn_name, [...]): Add prototypes.
* rtl.h (get_insn_name, print_rtl_with_bb): Add prototypes.
* print-rtl.c (get_insn_name): Remove prototype.
* toplev.h (progname): Declare const.
* toplev.c (init_decl_processing, init_obstacks, init_tree_codes,
init_regs, init_optabs, init_stmt, init_reg_sets, dump_flow_info,
dump_sched_info, dump_local_alloc, regset_release_memory,
print_rtl, print_rtl_with_bb, rest_of_decl_compilation,
error_with_file_and_line, error_with_decl, error_for_asm, error,
fatal, warning_with_file_and_line, warning_with_decl, warning,
pedwarn, pedwarn_with_decl, pedwarn_with_file_and_line, sorry):
Remove redundant prototypes.
(notice, check_lang_option, report_file_and_line, vnotice,
mark_file_stack): Add static prototype.
(set_fatal_function): Add prototype.
(vnotice, report_file_and_line, set_fatal_function,
check_lang_option): Constify a char*.
(main): Prototype. Call return, not exit.
cp:
* typeck2.c (ack): Don't declare progname.
From-SVN: r29433
1999-09-15 16:04:10 +02:00
return ( FATAL_EXIT_CODE ) ;
return ( SUCCESS_EXIT_CODE ) ;
1999-10-15 02:05:52 +02:00
}
1992-02-06 00:20:23 +01:00
/* Decode -m switches. */
/* Decode the switch -mNAME. */
Makefile.in (toplev.o): Depend on $(EXPR_H).
* Makefile.in (toplev.o): Depend on $(EXPR_H).
(insn-extract.o, insn-attrtab.o): Depend on toplev.h.
* gansidecl.h: Define ATTRIBUTE_NORETURN.
* genattrtab.c: Have insn-attrtab.c include toplev.h.
* genextract.c: Have insn-extract.c include toplev.h.
* rtl.h: Don't prototype `fatal_insn_not_found' and `fatal_insn'.
* toplev.c: Include expr.h.
(really_sorry, fancy_abort): Remove prototypes.
(set_target_switch): Add argument in prototype.
(vfatal): Mark prototype with ATTRIBUTE_NORETURN.
(v_really_sorry): Likewise.
(print_version, print_single_switch, print_switch_values): Make
static and add prototype arguments.
(decl_printable_name): Add prototype arguments.
(lang_expand_expr_t): New typedef.
(lang_expand_expr): Declare as a lang_expand_expr_t.
(incomplete_decl_finalize_hook): Add prototype argument.
(decl_name): Mark variable `verbosity' with ATTRIBUTE_UNUSED.
(botch): Likewise for variable `s'.
(rest_of_type_compilation): Mark variables `type' and `toplev'
with ATTRIBUTE_UNUSED if none of DBX_DEBUGGING_INFO,
XCOFF_DEBUGGING_INFO or SDB_DEBUGGING_INFO are defined.
(display_help): Make variable `i' an `unsigned long'.
(main): Remove unused parameter `envp'.
Cast assignment to `lang_expand_expr' to a `lang_expand_expr_t'.
Cast -1 when comparing it with a `size_t'.
* toplev.h (fatal, fatal_io_error, pfatal_with_name): Mark
prototype with ATTRIBUTE_NORETURN.
(fatal_insn_not_found, fatal_insn, really_sorry,
push_float_handler, pop_float_handler): Add prototypes.
(fancy_abort): Mark prototype with ATTRIBUTE_NORETURN.
(do_abort, botch): Add prototypes.
From-SVN: r22293
1998-09-06 07:56:20 +02:00
static void
1992-02-06 00:20:23 +01:00
set_target_switch ( name )
cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
* cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
Instead of writing to const char *buf directly, use a non-const
variable `wbuf' to allocate and write a string, then set buf = wbuf.
* cppulp.c (user_label_prefix): Qualify a char* with the `const'
keyword.
* dyn-string.c (dyn_string_append): Likewise.
* dyn-string.h (dyn_string_append): Likewise.
* final.c (end_final, output_operand_lossage, asm_fprintf): Likewise.
* output.h (end_final, output_operand_lossage, asm_fprintf,
named_section, decode_reg_name, make_decl_rtl, user_label_prefix):
Likewise.
* profile.c (init_branch_prob): Likewise.
* toplev.c (set_target_switch, vmessage,
v_message_with_file_and_line, v_message_with_decl,
v_error_with_file_and_line, v_error_with_decl, v_error_for_asm,
verror, vfatal, v_warning_with_file_and_line, v_warning_with_decl,
v_warning_for_asm, vwarning, vpedwarn, v_pedwarn_with_decl,
v_pedwarn_with_file_and_line, vsorry, v_really_sorry,
open_dump_file, dump_rtl, clean_dump_file,
print_version, print_single_switch, print_switch_values,
dump_base_name, debug_args, lang_independent_options,
user_label_prefix, documented_lang_options, target_switches,
target_options, print_time, pfatal_with_name, fatal_io_error,
fatal_insn, default_print_error_function, print_error_function,
report_error_function, error_with_file_and_line, error_with_decl,
error_for_asm, error, fatal, warning_with_file_and_line,
warning_with_decl, warning_for_asm, warning, pedwarn,
pedwarn_with_decl, pedwarn_with_file_and_line, sorry,
really_sorry, botch, output_quoted_string, output_file_directive,
open_dump_file, rest_of_decl_compilation, display_help, main):
Likewise.
* toplev.h (print_time, fatal, fatal_io_error, pfatal_with_name,
fatal_insn, warning, error, pedwarn, pedwarn_with_file_and_line,
warning_with_file_and_line, error_with_file_and_line, sorry,
really_sorry, default_print_error_function, report_error_function,
rest_of_decl_compilation, pedwarn_with_decl, warning_with_decl,
error_with_decl, error_for_asm, warning_for_asm, output_quoted_string,
output_file_directive, botch): Likewise.
* tree.h (make_decl_rtl): Likewise.
* varasm.c (strip_reg_name, named_section, decode_reg_name,
make_decl_rtl): Likewise.
From-SVN: r24743
1999-01-18 09:53:41 +01:00
const char * name ;
1992-02-06 00:20:23 +01:00
{
1998-03-12 01:02:51 +01:00
register size_t j ;
1999-01-27 02:43:17 +01:00
int valid_target_option = 0 ;
1992-02-06 00:20:23 +01:00
for ( j = 0 ; j < sizeof target_switches / sizeof target_switches [ 0 ] ; j + + )
if ( ! strcmp ( target_switches [ j ] . name , name ) )
{
if ( target_switches [ j ] . value < 0 )
target_flags & = ~ - target_switches [ j ] . value ;
else
target_flags | = target_switches [ j ] . value ;
1999-01-27 02:43:17 +01:00
valid_target_option = 1 ;
1992-02-06 00:20:23 +01:00
}
# ifdef TARGET_OPTIONS
1999-01-27 02:43:17 +01:00
if ( ! valid_target_option )
1992-02-06 00:20:23 +01:00
for ( j = 0 ; j < sizeof target_options / sizeof target_options [ 0 ] ; j + + )
{
int len = strlen ( target_options [ j ] . prefix ) ;
if ( ! strncmp ( target_options [ j ] . prefix , name , len ) )
{
* target_options [ j ] . variable = name + len ;
1999-01-27 02:43:17 +01:00
valid_target_option = 1 ;
1992-02-06 00:20:23 +01:00
}
}
# endif
1999-01-27 02:43:17 +01:00
if ( ! valid_target_option )
1992-02-06 00:20:23 +01:00
error ( " Invalid option `%s' " , name ) ;
}
1996-05-17 18:36:13 +02:00
/* Print version information to FILE.
Each line begins with INDENT ( for the case where FILE is the
assembler output file ) . */
1992-02-06 00:20:23 +01:00
Makefile.in (toplev.o): Depend on $(EXPR_H).
* Makefile.in (toplev.o): Depend on $(EXPR_H).
(insn-extract.o, insn-attrtab.o): Depend on toplev.h.
* gansidecl.h: Define ATTRIBUTE_NORETURN.
* genattrtab.c: Have insn-attrtab.c include toplev.h.
* genextract.c: Have insn-extract.c include toplev.h.
* rtl.h: Don't prototype `fatal_insn_not_found' and `fatal_insn'.
* toplev.c: Include expr.h.
(really_sorry, fancy_abort): Remove prototypes.
(set_target_switch): Add argument in prototype.
(vfatal): Mark prototype with ATTRIBUTE_NORETURN.
(v_really_sorry): Likewise.
(print_version, print_single_switch, print_switch_values): Make
static and add prototype arguments.
(decl_printable_name): Add prototype arguments.
(lang_expand_expr_t): New typedef.
(lang_expand_expr): Declare as a lang_expand_expr_t.
(incomplete_decl_finalize_hook): Add prototype argument.
(decl_name): Mark variable `verbosity' with ATTRIBUTE_UNUSED.
(botch): Likewise for variable `s'.
(rest_of_type_compilation): Mark variables `type' and `toplev'
with ATTRIBUTE_UNUSED if none of DBX_DEBUGGING_INFO,
XCOFF_DEBUGGING_INFO or SDB_DEBUGGING_INFO are defined.
(display_help): Make variable `i' an `unsigned long'.
(main): Remove unused parameter `envp'.
Cast assignment to `lang_expand_expr' to a `lang_expand_expr_t'.
Cast -1 when comparing it with a `size_t'.
* toplev.h (fatal, fatal_io_error, pfatal_with_name): Mark
prototype with ATTRIBUTE_NORETURN.
(fatal_insn_not_found, fatal_insn, really_sorry,
push_float_handler, pop_float_handler): Add prototypes.
(fancy_abort): Mark prototype with ATTRIBUTE_NORETURN.
(do_abort, botch): Add prototypes.
From-SVN: r22293
1998-09-06 07:56:20 +02:00
static void
1996-05-17 18:36:13 +02:00
print_version ( file , indent )
FILE * file ;
cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
* cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
Instead of writing to const char *buf directly, use a non-const
variable `wbuf' to allocate and write a string, then set buf = wbuf.
* cppulp.c (user_label_prefix): Qualify a char* with the `const'
keyword.
* dyn-string.c (dyn_string_append): Likewise.
* dyn-string.h (dyn_string_append): Likewise.
* final.c (end_final, output_operand_lossage, asm_fprintf): Likewise.
* output.h (end_final, output_operand_lossage, asm_fprintf,
named_section, decode_reg_name, make_decl_rtl, user_label_prefix):
Likewise.
* profile.c (init_branch_prob): Likewise.
* toplev.c (set_target_switch, vmessage,
v_message_with_file_and_line, v_message_with_decl,
v_error_with_file_and_line, v_error_with_decl, v_error_for_asm,
verror, vfatal, v_warning_with_file_and_line, v_warning_with_decl,
v_warning_for_asm, vwarning, vpedwarn, v_pedwarn_with_decl,
v_pedwarn_with_file_and_line, vsorry, v_really_sorry,
open_dump_file, dump_rtl, clean_dump_file,
print_version, print_single_switch, print_switch_values,
dump_base_name, debug_args, lang_independent_options,
user_label_prefix, documented_lang_options, target_switches,
target_options, print_time, pfatal_with_name, fatal_io_error,
fatal_insn, default_print_error_function, print_error_function,
report_error_function, error_with_file_and_line, error_with_decl,
error_for_asm, error, fatal, warning_with_file_and_line,
warning_with_decl, warning_for_asm, warning, pedwarn,
pedwarn_with_decl, pedwarn_with_file_and_line, sorry,
really_sorry, botch, output_quoted_string, output_file_directive,
open_dump_file, rest_of_decl_compilation, display_help, main):
Likewise.
* toplev.h (print_time, fatal, fatal_io_error, pfatal_with_name,
fatal_insn, warning, error, pedwarn, pedwarn_with_file_and_line,
warning_with_file_and_line, error_with_file_and_line, sorry,
really_sorry, default_print_error_function, report_error_function,
rest_of_decl_compilation, pedwarn_with_decl, warning_with_decl,
error_with_decl, error_for_asm, warning_for_asm, output_quoted_string,
output_file_directive, botch): Likewise.
* tree.h (make_decl_rtl): Likewise.
* varasm.c (strip_reg_name, named_section, decode_reg_name,
make_decl_rtl): Likewise.
From-SVN: r24743
1999-01-18 09:53:41 +01:00
const char * indent ;
1992-02-06 00:20:23 +01:00
{
1996-05-17 18:36:13 +02:00
# ifndef __VERSION__
1999-01-27 02:43:17 +01:00
# define __VERSION__ "[?]"
1996-05-17 18:36:13 +02:00
# endif
1999-01-27 02:43:17 +01:00
fnotice ( file ,
# ifdef __GNUC__
" %s%s%s version %s (%s) compiled by GNU C version %s. \n "
1996-05-17 18:36:13 +02:00
# else
1999-01-27 02:43:17 +01:00
" %s%s%s version %s (%s) compiled by CC. \n "
1996-05-17 18:36:13 +02:00
# endif
1999-01-27 02:43:17 +01:00
, indent , * indent ! = 0 ? " " : " " ,
language_string , version_string , TARGET_NAME , __VERSION__ ) ;
1996-05-17 18:36:13 +02:00
}
1992-02-06 00:20:23 +01:00
1996-05-17 18:36:13 +02:00
/* Print an option value and return the adjusted position in the line.
1996-08-29 00:07:28 +02:00
? ? ? We don ' t handle error returns from fprintf ( disk full ) ; presumably
other code will catch a disk full though . */
1992-02-06 00:20:23 +01:00
Makefile.in (toplev.o): Depend on $(EXPR_H).
* Makefile.in (toplev.o): Depend on $(EXPR_H).
(insn-extract.o, insn-attrtab.o): Depend on toplev.h.
* gansidecl.h: Define ATTRIBUTE_NORETURN.
* genattrtab.c: Have insn-attrtab.c include toplev.h.
* genextract.c: Have insn-extract.c include toplev.h.
* rtl.h: Don't prototype `fatal_insn_not_found' and `fatal_insn'.
* toplev.c: Include expr.h.
(really_sorry, fancy_abort): Remove prototypes.
(set_target_switch): Add argument in prototype.
(vfatal): Mark prototype with ATTRIBUTE_NORETURN.
(v_really_sorry): Likewise.
(print_version, print_single_switch, print_switch_values): Make
static and add prototype arguments.
(decl_printable_name): Add prototype arguments.
(lang_expand_expr_t): New typedef.
(lang_expand_expr): Declare as a lang_expand_expr_t.
(incomplete_decl_finalize_hook): Add prototype argument.
(decl_name): Mark variable `verbosity' with ATTRIBUTE_UNUSED.
(botch): Likewise for variable `s'.
(rest_of_type_compilation): Mark variables `type' and `toplev'
with ATTRIBUTE_UNUSED if none of DBX_DEBUGGING_INFO,
XCOFF_DEBUGGING_INFO or SDB_DEBUGGING_INFO are defined.
(display_help): Make variable `i' an `unsigned long'.
(main): Remove unused parameter `envp'.
Cast assignment to `lang_expand_expr' to a `lang_expand_expr_t'.
Cast -1 when comparing it with a `size_t'.
* toplev.h (fatal, fatal_io_error, pfatal_with_name): Mark
prototype with ATTRIBUTE_NORETURN.
(fatal_insn_not_found, fatal_insn, really_sorry,
push_float_handler, pop_float_handler): Add prototypes.
(fancy_abort): Mark prototype with ATTRIBUTE_NORETURN.
(do_abort, botch): Add prototypes.
From-SVN: r22293
1998-09-06 07:56:20 +02:00
static int
1996-05-17 18:36:13 +02:00
print_single_switch ( file , pos , max , indent , sep , term , type , name )
FILE * file ;
int pos , max ;
cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
* cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
Instead of writing to const char *buf directly, use a non-const
variable `wbuf' to allocate and write a string, then set buf = wbuf.
* cppulp.c (user_label_prefix): Qualify a char* with the `const'
keyword.
* dyn-string.c (dyn_string_append): Likewise.
* dyn-string.h (dyn_string_append): Likewise.
* final.c (end_final, output_operand_lossage, asm_fprintf): Likewise.
* output.h (end_final, output_operand_lossage, asm_fprintf,
named_section, decode_reg_name, make_decl_rtl, user_label_prefix):
Likewise.
* profile.c (init_branch_prob): Likewise.
* toplev.c (set_target_switch, vmessage,
v_message_with_file_and_line, v_message_with_decl,
v_error_with_file_and_line, v_error_with_decl, v_error_for_asm,
verror, vfatal, v_warning_with_file_and_line, v_warning_with_decl,
v_warning_for_asm, vwarning, vpedwarn, v_pedwarn_with_decl,
v_pedwarn_with_file_and_line, vsorry, v_really_sorry,
open_dump_file, dump_rtl, clean_dump_file,
print_version, print_single_switch, print_switch_values,
dump_base_name, debug_args, lang_independent_options,
user_label_prefix, documented_lang_options, target_switches,
target_options, print_time, pfatal_with_name, fatal_io_error,
fatal_insn, default_print_error_function, print_error_function,
report_error_function, error_with_file_and_line, error_with_decl,
error_for_asm, error, fatal, warning_with_file_and_line,
warning_with_decl, warning_for_asm, warning, pedwarn,
pedwarn_with_decl, pedwarn_with_file_and_line, sorry,
really_sorry, botch, output_quoted_string, output_file_directive,
open_dump_file, rest_of_decl_compilation, display_help, main):
Likewise.
* toplev.h (print_time, fatal, fatal_io_error, pfatal_with_name,
fatal_insn, warning, error, pedwarn, pedwarn_with_file_and_line,
warning_with_file_and_line, error_with_file_and_line, sorry,
really_sorry, default_print_error_function, report_error_function,
rest_of_decl_compilation, pedwarn_with_decl, warning_with_decl,
error_with_decl, error_for_asm, warning_for_asm, output_quoted_string,
output_file_directive, botch): Likewise.
* tree.h (make_decl_rtl): Likewise.
* varasm.c (strip_reg_name, named_section, decode_reg_name,
make_decl_rtl): Likewise.
From-SVN: r24743
1999-01-18 09:53:41 +01:00
const char * indent , * sep , * term , * type , * name ;
1996-05-17 18:36:13 +02:00
{
1996-08-29 00:07:28 +02:00
/* The ultrix fprintf returns 0 on success, so compute the result we want
here since we need it for the following test . */
int len = strlen ( sep ) + strlen ( type ) + strlen ( name ) ;
1996-05-17 18:36:13 +02:00
if ( pos ! = 0
1996-08-29 00:07:28 +02:00
& & pos + len > max )
1992-02-06 00:20:23 +01:00
{
1996-05-17 18:36:13 +02:00
fprintf ( file , " %s " , term ) ;
pos = 0 ;
1992-02-06 00:20:23 +01:00
}
1996-05-17 18:36:13 +02:00
if ( pos = = 0 )
{
1996-08-29 00:07:28 +02:00
fprintf ( file , " %s " , indent ) ;
pos = strlen ( indent ) ;
1996-05-17 18:36:13 +02:00
}
1996-08-29 00:07:28 +02:00
fprintf ( file , " %s%s%s " , sep , type , name ) ;
pos + = len ;
1996-05-17 18:36:13 +02:00
return pos ;
1992-02-06 00:20:23 +01:00
}
1996-05-17 18:36:13 +02:00
/* Print active target switches to FILE.
POS is the current cursor position and MAX is the size of a " line " .
Each line begins with INDENT and ends with TERM .
Each switch is separated from the next by SEP . */
1992-02-06 00:20:23 +01:00
1998-09-07 22:35:41 +02:00
static void
1996-05-17 18:36:13 +02:00
print_switch_values ( file , pos , max , indent , sep , term )
FILE * file ;
int pos , max ;
cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
* cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
Instead of writing to const char *buf directly, use a non-const
variable `wbuf' to allocate and write a string, then set buf = wbuf.
* cppulp.c (user_label_prefix): Qualify a char* with the `const'
keyword.
* dyn-string.c (dyn_string_append): Likewise.
* dyn-string.h (dyn_string_append): Likewise.
* final.c (end_final, output_operand_lossage, asm_fprintf): Likewise.
* output.h (end_final, output_operand_lossage, asm_fprintf,
named_section, decode_reg_name, make_decl_rtl, user_label_prefix):
Likewise.
* profile.c (init_branch_prob): Likewise.
* toplev.c (set_target_switch, vmessage,
v_message_with_file_and_line, v_message_with_decl,
v_error_with_file_and_line, v_error_with_decl, v_error_for_asm,
verror, vfatal, v_warning_with_file_and_line, v_warning_with_decl,
v_warning_for_asm, vwarning, vpedwarn, v_pedwarn_with_decl,
v_pedwarn_with_file_and_line, vsorry, v_really_sorry,
open_dump_file, dump_rtl, clean_dump_file,
print_version, print_single_switch, print_switch_values,
dump_base_name, debug_args, lang_independent_options,
user_label_prefix, documented_lang_options, target_switches,
target_options, print_time, pfatal_with_name, fatal_io_error,
fatal_insn, default_print_error_function, print_error_function,
report_error_function, error_with_file_and_line, error_with_decl,
error_for_asm, error, fatal, warning_with_file_and_line,
warning_with_decl, warning_for_asm, warning, pedwarn,
pedwarn_with_decl, pedwarn_with_file_and_line, sorry,
really_sorry, botch, output_quoted_string, output_file_directive,
open_dump_file, rest_of_decl_compilation, display_help, main):
Likewise.
* toplev.h (print_time, fatal, fatal_io_error, pfatal_with_name,
fatal_insn, warning, error, pedwarn, pedwarn_with_file_and_line,
warning_with_file_and_line, error_with_file_and_line, sorry,
really_sorry, default_print_error_function, report_error_function,
rest_of_decl_compilation, pedwarn_with_decl, warning_with_decl,
error_with_decl, error_for_asm, warning_for_asm, output_quoted_string,
output_file_directive, botch): Likewise.
* tree.h (make_decl_rtl): Likewise.
* varasm.c (strip_reg_name, named_section, decode_reg_name,
make_decl_rtl): Likewise.
From-SVN: r24743
1999-01-18 09:53:41 +01:00
const char * indent , * sep , * term ;
1992-02-06 00:20:23 +01:00
{
1998-03-12 01:02:51 +01:00
size_t j ;
1996-05-17 18:36:13 +02:00
char * * p ;
/* Print the options as passed. */
1992-02-06 00:20:23 +01:00
1996-05-17 18:36:13 +02:00
pos = print_single_switch ( file , pos , max , indent , * indent ? " " : " " , term ,
1999-01-27 02:43:17 +01:00
_ ( " options passed: " ) , " " ) ;
1996-05-17 18:36:13 +02:00
1996-05-17 21:55:44 +02:00
for ( p = & save_argv [ 1 ] ; * p ! = NULL ; p + + )
1996-05-17 18:36:13 +02:00
if ( * * p = = ' - ' )
{
/* Ignore these. */
1996-05-17 21:55:44 +02:00
if ( strcmp ( * p , " -o " ) = = 0 )
{
if ( p [ 1 ] ! = NULL )
p + + ;
continue ;
}
1996-05-17 18:36:13 +02:00
if ( strcmp ( * p , " -quiet " ) = = 0 )
continue ;
if ( strcmp ( * p , " -version " ) = = 0 )
continue ;
if ( ( * p ) [ 1 ] = = ' d ' )
continue ;
pos = print_single_switch ( file , pos , max , indent , sep , term , * p , " " ) ;
}
if ( pos > 0 )
fprintf ( file , " %s " , term ) ;
/* Print the -f and -m options that have been enabled.
We don ' t handle language specific options but printing argv
should suffice . */
pos = print_single_switch ( file , 0 , max , indent , * indent ? " " : " " , term ,
1999-01-27 02:43:17 +01:00
_ ( " options enabled: " ) , " " ) ;
1992-02-06 00:20:23 +01:00
for ( j = 0 ; j < sizeof f_options / sizeof f_options [ 0 ] ; j + + )
if ( * f_options [ j ] . variable = = f_options [ j ] . on_value )
1996-05-17 18:36:13 +02:00
pos = print_single_switch ( file , pos , max , indent , sep , term ,
" -f " , f_options [ j ] . string ) ;
1992-02-06 00:20:23 +01:00
1996-05-17 18:36:13 +02:00
/* Print target specific options. */
1992-02-06 00:20:23 +01:00
for ( j = 0 ; j < sizeof target_switches / sizeof target_switches [ 0 ] ; j + + )
if ( target_switches [ j ] . name [ 0 ] ! = ' \0 '
& & target_switches [ j ] . value > 0
& & ( ( target_switches [ j ] . value & target_flags )
= = target_switches [ j ] . value ) )
1996-05-17 18:36:13 +02:00
{
pos = print_single_switch ( file , pos , max , indent , sep , term ,
" -m " , target_switches [ j ] . name ) ;
}
# ifdef TARGET_OPTIONS
for ( j = 0 ; j < sizeof target_options / sizeof target_options [ 0 ] ; j + + )
if ( * target_options [ j ] . variable ! = NULL )
{
char prefix [ 256 ] ;
sprintf ( prefix , " -m%s " , target_options [ j ] . prefix ) ;
pos = print_single_switch ( file , pos , max , indent , sep , term ,
prefix , * target_options [ j ] . variable ) ;
}
# endif
1992-02-06 00:20:23 +01:00
1996-05-17 18:36:13 +02:00
fprintf ( file , " %s " , term ) ;
1992-02-06 00:20:23 +01:00
}
1996-11-15 08:14:08 +01:00
/* Record the beginning of a new source file, named FILENAME. */
void
debug_start_source_file ( filename )
Warning fixes:
* c-lex.c (yylex): Remove unused variable `bytes'.
* flow.c (print_rtl_with_bb): Cast the return value of alloca.
* function.c (assign_parms): Wrap variable `varargs_setup' in
macro SETUP_INCOMING_VARARGS.
(thread_prologue_and_epilogue_insns): Mark parameter `f' with
ATTRIBUTE_UNUSED.
* local-alloc.c (no_equiv): Likewise for parameter `store'.
* sched.c (schedule_insns): Remove unused variables `insn' and `next'.
* tlink.c (symbol_hash_newfunc, symbol_hash_lookup,
file_hash_newfunc, file_hash_lookup, demangled_hash_newfunc,
demangled_hash_lookup, symbol_push, symbol_pop, file_push,
file_pop, tlink_init, tlink_execute, frob_extension,
obstack_fgets, tfgets, pfgets, freadsym, read_repo_file,
maybe_tweak, recompile_files, read_repo_files,
demangle_new_symbols, scan_linker_output): Add static prototype.
(symbol_hash_newfunc, file_hash_newfunc, demangled_hash_newfunc):
Make the third argument a `hash_table_key'.
* toplev.c (debug_start_source_file): Mark parameter `filename'
with ATTRIBUTE_UNUSED.
From-SVN: r25871
1999-03-20 20:21:31 +01:00
register char * filename ATTRIBUTE_UNUSED ;
1996-11-15 08:14:08 +01:00
{
# ifdef DBX_DEBUGGING_INFO
if ( write_symbols = = DBX_DEBUG )
dbxout_start_new_source_file ( filename ) ;
# endif
# ifdef DWARF_DEBUGGING_INFO
if ( debug_info_level = = DINFO_LEVEL_VERBOSE
& & write_symbols = = DWARF_DEBUG )
dwarfout_start_new_source_file ( filename ) ;
# endif /* DWARF_DEBUGGING_INFO */
# ifdef DWARF2_DEBUGGING_INFO
if ( debug_info_level = = DINFO_LEVEL_VERBOSE
& & write_symbols = = DWARF2_DEBUG )
dwarf2out_start_source_file ( filename ) ;
# endif /* DWARF2_DEBUGGING_INFO */
1996-11-15 23:37:40 +01:00
# ifdef SDB_DEBUGGING_INFO
if ( write_symbols = = SDB_DEBUG )
sdbout_start_new_source_file ( filename ) ;
# endif
1996-11-15 08:14:08 +01:00
}
/* Record the resumption of a source file. LINENO is the line number in
the source file we are returning to . */
void
debug_end_source_file ( lineno )
1998-10-13 17:25:25 +02:00
register unsigned lineno ATTRIBUTE_UNUSED ;
1996-11-15 08:14:08 +01:00
{
# ifdef DBX_DEBUGGING_INFO
if ( write_symbols = = DBX_DEBUG )
dbxout_resume_previous_source_file ( ) ;
# endif
# ifdef DWARF_DEBUGGING_INFO
if ( debug_info_level = = DINFO_LEVEL_VERBOSE
& & write_symbols = = DWARF_DEBUG )
dwarfout_resume_previous_source_file ( lineno ) ;
# endif /* DWARF_DEBUGGING_INFO */
# ifdef DWARF2_DEBUGGING_INFO
if ( debug_info_level = = DINFO_LEVEL_VERBOSE
& & write_symbols = = DWARF2_DEBUG )
dwarf2out_end_source_file ( ) ;
# endif /* DWARF2_DEBUGGING_INFO */
1996-11-15 23:37:40 +01:00
# ifdef SDB_DEBUGGING_INFO
if ( write_symbols = = SDB_DEBUG )
sdbout_resume_previous_source_file ( ) ;
# endif
1996-11-15 08:14:08 +01:00
}
/* Called from check_newline in c-parse.y. The `buffer' parameter contains
the tail part of the directive line , i . e . the part which is past the
initial whitespace , # , whitespace , directive - name , whitespace part . */
void
debug_define ( lineno , buffer )
1999-03-19 09:50:14 +01:00
register unsigned lineno ATTRIBUTE_UNUSED ;
register char * buffer ATTRIBUTE_UNUSED ;
1996-11-15 08:14:08 +01:00
{
# ifdef DWARF_DEBUGGING_INFO
if ( debug_info_level = = DINFO_LEVEL_VERBOSE
& & write_symbols = = DWARF_DEBUG )
dwarfout_define ( lineno , buffer ) ;
# endif /* DWARF_DEBUGGING_INFO */
# ifdef DWARF2_DEBUGGING_INFO
if ( debug_info_level = = DINFO_LEVEL_VERBOSE
& & write_symbols = = DWARF2_DEBUG )
dwarf2out_define ( lineno , buffer ) ;
# endif /* DWARF2_DEBUGGING_INFO */
}
/* Called from check_newline in c-parse.y. The `buffer' parameter contains
the tail part of the directive line , i . e . the part which is past the
initial whitespace , # , whitespace , directive - name , whitespace part . */
void
debug_undef ( lineno , buffer )
1999-03-19 09:50:14 +01:00
register unsigned lineno ATTRIBUTE_UNUSED ;
register char * buffer ATTRIBUTE_UNUSED ;
1996-11-15 08:14:08 +01:00
{
# ifdef DWARF_DEBUGGING_INFO
if ( debug_info_level = = DINFO_LEVEL_VERBOSE
& & write_symbols = = DWARF_DEBUG )
dwarfout_undef ( lineno , buffer ) ;
# endif /* DWARF_DEBUGGING_INFO */
# ifdef DWARF2_DEBUGGING_INFO
if ( debug_info_level = = DINFO_LEVEL_VERBOSE
& & write_symbols = = DWARF2_DEBUG )
dwarf2out_undef ( lineno , buffer ) ;
# endif /* DWARF2_DEBUGGING_INFO */
}