* gcc.c: Include sys/resource.h.
(report_times): New flag.
(execute): If report_times is set, calculate and report the
CPU time consumed by each subprocess.
(rus, prus): New globals.
(option_map): Add --time.
(display_help): Document -time.
(process_command): Set report_times if -time is given.
Turn off -pipe if -time is given.
* invoke.texi: Document new option -time.
* configure.in: Check for getrusage. Check if we have to
prototype getrusage.
* acconfig.h: Add NEED_DECLARATION_GETRUSAGE.
* configure: Regenerate.
* config.in: Regenerate.
* Makefile.in (gcc.o, gccspec.o, cppspec.o): Depend on gcc.h.
* gcc.h: New file.
(lang_specific_driver): Don't take a function pointer parameter.
All callers changed.
* gcc.c: Include gcc.h.
(do_spec, fancy_abort,lang_specific_driver,lang_specific_pre_link,
lang_specific_extra_outfiles, fatal): Don't declare.
(multilib_defaults_raw): Constify.
(read_specs): Call memset, rather than bzero.
(main): Call return, not exit.
(lookup_compiler): Call memcpy, not bcopy.
(fatal): Make extern.
* cppspec.c: Include gcc.h.
(lang_specific_driver): Initialize variable `quote'. Constify a
char*. All calls to the function pointer parameter now
explicitly call `fatal'.
* gccspec.c (lang_specific_driver): Include gcc.h.
cp:
* Make-lang.in (g++spec.o): Depend on system.h and gcc.h.
* g++spec.c: Include gcc.h.
(lang_specific_driver): Constify a char*. Call xcalloc, not
xmalloc/bzero. All calls to the function pointer parameter now
explicitly call `fatal'.
f:
* Make-lang.in (g77spec.o): Depend on system.h and gcc.h.
* g77spec.c: Include gcc.h.
(g77_xargv): Constify.
(g77_fn): Add parameter prototypes.
(lookup_option, append_arg): Add static prototypes.
(g77_newargv): Constify.
(lookup_option, append_arg, lang_specific_driver): Constify a char*.
(lang_specific_driver): All calls to the function pointer
parameter now explicitly call `fatal'.
java:
* Make-lang.in (jvspec.o): Depend on system.h and gcc.h.
* jvspec.c: Include gcc.h. Don't include gansidecl.h.
(do_spec, lang_specific_pre_link, lang_specific_driver,
input_filename, input_filename_length): Don't declare.
(main_class_name, jvgenmain_spec, lang_specific_driver):
Constify a char*.
(lang_specific_driver): All calls to the function pointer
parameter now explicitly call `fatal'.
Mark Mitchell [Mon, 13 Sep 1999 00:35:00 +0000 (00:35 +0000)]
call.c (implicit_conversion): Robustify.
* call.c (implicit_conversion): Robustify. Handle OFFSET_REFs.
* cvt.c (ocp_convert): Complete the from and destination types.
Adjust warning about functions always being `true' in conditionals.
* decl.c (duplicate_decls): Don't play funny games with abort.
* error.c (dump_expr): Handle OVERLOADs.
* spew.c (probe_obstack): Remove.
* typeck.c (condition_conversion): Use perform_implicit_conversion.
Mark Mitchell [Sun, 12 Sep 1999 01:12:59 +0000 (01:12 +0000)]
cp-tree.def (CLEANUP_STMT): New node.
* cp-tree.def (CLEANUP_STMT): New node.
* cp-tree.h (language_function): Add name_declared.
(current_function_name_declared): New macro.
(CLEANUP_DECL): New macro.
(CLEANUP_EXPR): Likewise.
(emit_local_var): Likewise.
(finish_decl_cleanup): New function.
* cvt.c (build_up_reference): Simplify.
(ocp_convert): Remove dead code.
* decl.c (start_decl): Remove call to add_decl_stmt.
(grok_reference_init): Adjust, to handle bindings temporaries to
references. Remove dead code.
(initialize_local_var): Don't generate RTL for
declarations here, or build cleanups here. Don't fuss with
obstacks. Replace expand_start_target_temps calls with explicit
setting of stms_are_full_exprs_p.
(destroy_local_var): New function.
(emit_local_var): Likewise.
(cp_finish_decl): Use them, as appropriate.
(start_function): Announce template functions.
(store_parm_decls): Don't call declare_function_name here.
(finish_stmt): Don't start emit base-initialization code when just
building the statement-tree.
* init.c (create_temporary_var): Move add_decl_stmt call ...
(get_temp_regvar): Here.
* pt.c (tsubst_expr): Make DECL_INITIAL look like what
cp_finish_decl would expect. Don't call add_decl_stmt.
* semantics.c (begin_compound_stmt): Call declare_function_name,
if appropriate.
(finish_decl_cleanup): New function.
(expand_stmt): Use emit_local_var to output variables.
(expand_body): Set current_funtion_name_declared.
* cppalloc.c (xstrdup): Use memcpy.
* cpperror.c (cpp_print_containing_files): Don't use
cpp_notice.
* cpplib.c (conditional_skip): Set temp->lineno.
(do_endif): Make error message less obscure.
(if_directive_name): New function.
(cpp_get_token [case EOF]): Unwind the if stack and generate
error messages for each unterminated conditional in this file.
(parse_string): Do not behave differently if -traditional.
Tom Tromey [Fri, 10 Sep 1999 22:03:10 +0000 (22:03 +0000)]
configure: Rebuilt.
* configure: Rebuilt.
* configure.in: Build include/Makefile.
* Makefile.in: Rebuilt.
* Makefile.am (SUBDIRS): Added gcj and include.
(install-data-local): New target.
(extra_headers): New macro.
* include/Makefile.in: New file.
* include/Makefile.am: New file.
* interpret.cc: Don't include gcj/field.h or gcj/cni.h.
* java/lang/reflect/natField.cc: Don't include gcj/field.h or
gcj/cni.h.
* boehm.cc: Don't include java-threads.h or gcj/field.h.
* resolve.cc: Include config.h.
* defineclass.cc: Include config.h.
* include/java-interp.h: Don't include config.h.
* include/jvm.h: Include java-threads.h, Object.h, java-gc.h,
cni.h.
* gcj/javaprims.h: Regenerated namespace decls.
* classes.pl (scan): Don't put `;' after closing brace.
* Makefile.in: Rebuilt.
* Makefile.am (INCLUDES): Added -I for top_srcdir.
* configure.in: Create gcj/Makefile.
* gcj/Makefile.in: New file.
* gcj/Makefile.am: New file.
* java/lang/Object.h: Don't include any other headers.
* gcj/array.h: Renamed from include/java-array.h.
* gcj/field.h: Renamed from include/java-field.h.
* gcj/method.h: Renamed from include/java-method.h.
* gcj/cni.h, gcj/javaprims.h: Moved from include/.
Updated all files to reflect new include structure.
Tom Tromey [Fri, 10 Sep 1999 21:45:39 +0000 (21:45 +0000)]
gjavah.c (add_class_decl): Generate include for gcj/array.h, not java-array.h.
* gjavah.c (add_class_decl): Generate include for gcj/array.h, not
java-array.h.
(decode_signature_piece): Don't emit "::" in JArray<>.
(print_namelet): Only print trailing `;' when printing a class.
builtins.c (expand_builtin_va_arg): Cope with an array-type va_list decomposing to pointer-type.
* builtins.c (expand_builtin_va_arg): Cope with an array-type
va_list decomposing to pointer-type.
* rs6000.c (rs6000_va_start) Unwrap the ARRAY_TYPE to get at fields.
(rs6000_va_arg): Likewise.
Mark Mitchell [Fri, 10 Sep 1999 10:19:47 +0000 (10:19 +0000)]
cp-tree.h (language_function): Rename expanding_p to x_expanding_p.
* cp-tree.h (language_function): Rename expanding_p to
x_expanding_p. Rename named_label_uses to x_named_label_uses.
(expanding_p): Adjust accordingly.
(TREE_VIA_PRIVATE): Fix typo in comment.
(DECL_REFERENCE_SLOT): Remove.
(SET_DECL_REFERENCE_SLOT): Likewise.
* decl.c (named_label_uses): Adjust. Remove chicken comment.
(push_overloaded_decl): Don't truncate the chain of bindings when
adding an overloaded function.
(grok_reference_init): Don't use DECL_REFERENCE_SLOT.
(initialize_local_var): Fix typo in comment.
(store_parm_decls): Don't set DECL_REFERENCE_SLOT. Tidy up.
* decl2.c (start_objects): Make the fact that we are expanding
the generated function right away explicit.
(start_static_storage_duration_function): Likewise.
(finish_file): Fix typo in comment.
* init.c (build_vec_init): Correct bugs in handling cleanups.
* semantics.c (maybe_convert_cond): New function.
(FINISH_COND): Always store the condition, even if there's
a declaration.
(finish_if_stmt_cond): Use maybe_convert_cond.
(finish_while_stmt_cond): Likewise.
(finish_do_stmt): Likewise.
(finish_for_cond): Likewise.
(expand_cond): Adjust.
Mark Mitchell [Fri, 10 Sep 1999 09:21:37 +0000 (09:21 +0000)]
cp-tree.h (FN_TRY_BLOCK_P): New macro.
* cp-tree.h (FN_TRY_BLOCK_P): New macro.
* init.c (perform_member_init): Remove obstack machinations.
(expand_cleanup_for_base): Likewise.
(finish_init_stmts): Mark the statement-expression as used.
* method.c (emit_thunk): Use tree-generating functions, not
RTL.
(do_build_copy_constructor): Likewise.
(do_build_assign_ref): Likewise.
(synthesize_method): Likewise. Keep track of line numbers.
* pt.c (tsubst_expr): Handle various kinds of try blocks.
* semantics.c (expand_stmts): Remove.
(begin_function_try_block): Set FN_TRY_BLOCK_P.
(finish_function_try_block): Be careful rechaining
function try blocks.
(expand_stmt): Loop through all the statements at a given level.
(exapnd_body): Be careful with line-numbers here too. Prepare for
being called directly from the parser.
Mark Mitchell [Fri, 10 Sep 1999 08:30:08 +0000 (08:30 +0000)]
cp-tree.h (CPTI_ATEXIT): New macro.
* cp-tree.h (CPTI_ATEXIT): New macro.
(atexit_node): Likewise.
* decl.c (destroy_local_static): New function, broken out from ...
(expand_static_init): Here.
Mark Mitchell [Fri, 10 Sep 1999 08:14:16 +0000 (08:14 +0000)]
rtti.c (get_tinfo_var): These should always be global
* rtti.c (get_tinfo_var): These should always be global
(expand_si_desc): Use tree, not RTL, functions to generate code.
(expand_class_desc): Likewise.
(expand_ptr_desc): Likewise.
(expand_attr_desc): Likewise.
(expand_generic_desc): Likewise.
(synthesize_tinfo_fn): Likewise.
i386.c (override_options): Remove ppro, pentium2, and p2 as aliases.
* i386.c (override_options): Remove ppro, pentium2, and p2 as aliases.
Default ix86_arch to PROCESSOR_I386.
* i386.h (CC1_CPU_SPEC): Don't add -march=foo. Remove -mno-foo.
(CPP_486_SPEC, CPP_586_SPEC, CPP_686_SPEC): Delete.
(CPP_CPU_DEFAULT_SPEC): Define to __tune_foo__.
(CC1_CPU_SPEC): Make -march=foo define __foo__, and provide
__tune_foo__ if no -mcpu. Make -mcpu=bar define __tune_bar__.
(EXTRA_SPECS): Remove deleted specs.
Mark Mitchell [Thu, 9 Sep 1999 23:24:34 +0000 (23:24 +0000)]
cp-tree.h (EXPR_STMT_ASSIGNS_THIS): New macro.
* cp-tree.h (EXPR_STMT_ASSIGNS_THIS): New macro.
(STMT_IS_FULL_EXPR_P): Likewise.
(STMT_LINENO_FOR_FN_P): Likewise.
(prep_stmt): New function.
(building_stmt_tree): Tweak for safety.
* pt.c (tsubst_expr): Use prep_stmt throughout.
(add_tree): Move it to semantics.c
* semantics.c (add_tree): Move it here.
(finish_expr_stmt_real): New function.
(finish_expr_stmt): Use it.
(finish_if_stmt_cond): Use FINISH_COND.
(finish_while_stmt_cond): Likewise.
(finish_for_cond): Likewise.
(finish_stmt_tree): Tweak line-number handling.
(prep_stmt): New function.
(expand_stmt): Use it.
Mark Mitchell [Thu, 9 Sep 1999 21:47:28 +0000 (21:47 +0000)]
decl.c (lang_mark_tree): Mark TYPE_LANG_SPECIFIC.
* decl.c (lang_mark_tree): Mark TYPE_LANG_SPECIFIC.
(lang_cleanup_tree): Remove.
* lex.c (make_lang_type): Use ggc_alloc to allocate
TYPE_LANG_SPECIFIC.
Mark Mitchell [Thu, 9 Sep 1999 19:02:39 +0000 (19:02 +0000)]
Reorganize per-function data.
* cp-tree.h (saved_scope): Add function_decl, bindings.
(language_function): Rename binding_level to bindings.
(cp_function_chain): Use the current_function, not the
outer_function_chain.
(current_class_ptr): Make it work, even when there's no
current function.
(current_class_ref): Likewise.
(SF_DEFAULT, SF_PRE_PARSED, SF_INCLASS_INLINE, SF_EXPAND): New
macros.
(clear_temp_name): Remove.
* decl.c (check_function_type): New function, broken out from
start_function.
(current_binding_level): Adjust definition.
(pushlevel): Simplify.
(poplevel): Don't use named_label_uses when we're outside
a function scope.
(mark_saved_scope): Mark function_decl and bindings.
(maybe_push_to_top_level): Don't unconditionally push a new
function context. Save bindings and the current_function_decl.
Don't clear named_labels.
(pop_from_top_level): Pop function context if appropriate.
(init_decl_processing): Set init_lang_status and free_lang_status,
rather than save_lang_status and restore_lang_status.
(start_function): Take SF_* flags. Don't clear per-function data.
Reorder and simplify to use new per-function data code. Add
asserts.
(store_parm_decls): Don't call init_function_start here.
(finish_function): Adjust for new handling of per-function data.
(push_cp_function_context): Simplify.
(mark_cp_function_context): Change binding_level to bindings.
* decl2.c (clear_temp_name): Remove.
(start_objects): Use SF flags to start_function.
(start_static_storage_duration_function): Likewise.
* except.c (start_anon_func): Remove redundant calls to
push_function_context_to. Use SF flags to start function.
(end_anon_func): Remove redundant call to pop_function_context
from.
* lex.c (reinit_parse_for_function): Don't initialize per-function
data.
* method.c (emit_thunk): Clear current_function after calling
assemble_end_function. Use SF flags for start_function.
(synthesize_method): Use SF flags for start_function.
* parse.c: Regenerated.
* parse.y (fn.defpen): Likewise.
(pending_inline): Clear current_function, even if something goes
wrong.
* pt.c (instantiate_decl): Use SF flags to start_function.
Don't save and restore expanding_p.
(add_tree): Handle the case where we are outside any function.
(end_tree): Likewise.
* rtti.c (sythesize_tinfo_fn): Use SF flags to start_function.
* semantics.c (begin_function_definition): Likewise.
(expand_body): Likewise.
* arm.c: Include "ggc.h".
(arm_add_gc_roots): New function.
(arm_override_options): Call it.
(aof_pic_entry): Add a GC root for aof_pic_label when it's allocated.
* arm.md (define_asm_attributes): Add a pool_range attribute.
* g++.old-deja/g++.other/lookup11.C: New test.
* g++.old-deja/g++.bugs/900428_01.C: Rework now we understand
what is permitted and what we want.
* g++.old-deja/g++.jason/rfg4.C: Rework to remove ill-formed
overload use.
* g++.old-deja/g++.jason/rfg5.C: Likewise
* ggc-simple.c (IS_MARKED, IGNORE_MARK): New.
(GGC_ANY_MAGIC, GGC_ANY_MAGIC_MARK): New.
(struct ggc_any): Replace `mark' with `magic_mark'.
(ggc_alloc_string): Use memcpy, not bcopy.
(ggc_alloc_any): Set magic_mark. Update bytes_alloced_since_gc.
(ggc_free_{rtx,rtvec,tree,string}): Mark inline.
(ggc_free_any): New.
(ggc_mark_string): Use IGNORE_MARK. Calc back to struct gcc_string.
(ggc_mark): Use IGNORE_MARK. Abort if magic doesn't match.
(ggc_collect): Re-enable collection avoidance. Use GGC_ANY_MARK.
Use IS_MARKED. Use ggc_free_any.
combine.c (SUBST): Break out to a real function do_SUBST.
* combine.c (SUBST): Break out to a real function do_SUBST.
(SUBST_INT): Likewise.
* gcse.c (free_pre_mem): Free `temp_bitmap'.
(pre_insert): Free `inserted'.
* loop.c (basic_induction_var): Always set `location'.
* function.c (expand_function_end): Add initial_trampoline as a root.
* rtl.h (init_varasm_once): Declare.
* toplev.c (compile_file): Call it.
* ggc-simple.c (ggc_mark_string_ptr): New.
(ggc_add_string_root): New.
(ggc_collect): Disable collection avoidance temporarily.
* ggc.h (ggc_add_string_root): Declare.
* except.c (create_rethrow_ref): Use ggc_alloc_string.
* optabs.c (init_libfuncs): Likewise.
* varasm.c (named_section): Use ggc_alloc_string.
(make_function_rtl): Likewise.
(make_decl_rtl): Likewise.
(assemble_static_space): Likewise.
(assemble_trampoline_template): Likewise.
(output_constant_def): Likewise.
(force_const_mem): Likewise.
(mark_const_hash_entry): New.
(mark_pool_sym_hash_table): New.
(mark_varasm_state): Use it.
(init_varasm_once): New.
Mark Mitchell [Thu, 9 Sep 1999 03:26:58 +0000 (03:26 +0000)]
ggc.h (ggc_alloc): New function.
* ggc.h (ggc_alloc): New function.
(ggc_mark): Likewise.
* ggc-simple.c (ggc_any): New structure.
(ggc_status): Add anys.
(n_anys_collected): New variable.
(ggc_alloc): Define.
(ggc_mark): Likewise.
(ggc_collect): Collect the anys.