Commit Graph

76 Commits

Author SHA1 Message Date
Kazu Hirata aa335b7641 cfgloop.h, [...]: Update copyright.
gcc/
	* cfgloop.h, cfgloopanal.c, cpplex.c, except.h, loop-init.c,
	loop-unroll.c, scan-decls.c, scan.h, stor-layout.c,
	xcoffout.c, xcoffout.h, config/arm/mmintrin.h,
	config/mips/linux64.h, config/pa/pa-64.h,
	config/rs6000/aix51.h, config/rs6000/aix52.h,
	config/rs6000/spe.md, config/sparc/linux.h,
	config/sparc/linux64.h: Update copyright.

gcc/cp/
	* cp-tree.def, cvt.c: Update copyright.

From-SVN: r78032
2004-02-18 15:05:17 +00:00
James E Wilson c76362b488 re PR libstdc++/5625 ([mips] exception unwinding creates invalid pointer on mips)
PR libstdc++/5625
* builtin-types.def (BT_WORD, BT_FN_WORD_PTR): New.
* builtins.c (expand_builtin): Handle BUILT_IN_EXTEND_POINTER.
* builtins.def (BUILT_IN_EXTEND_POINTER): New.
* except.c (expand_builtin_extend_pointer): New.
* except.h (expand_builtin_extend_pointer): Declare.

From-SVN: r77554
2004-02-09 13:18:45 -08:00
Rainer Orth c14aea876f except.h (MUST_USE_SJLJ_EXCEPTIONS): Revert 2003-09-23 change.
* except.h (MUST_USE_SJLJ_EXCEPTIONS): Revert 2003-09-23 change.
	Allow override.
	* doc/tm.texi (MUST_USE_SJLJ_EXCEPTIONS): Document.

From-SVN: r71985
2003-10-01 18:54:46 +00:00
Rainer Orth 5748beec64 except.h (MUST_USE_SJLJ_EXCEPTIONS): Test for DWARF2_UNWIND_INFO value.
* except.h (MUST_USE_SJLJ_EXCEPTIONS): Test for DWARF2_UNWIND_INFO
	value.

From-SVN: r71690
2003-09-23 19:29:56 +00:00
Andreas Jaeger 502b832280 except.c: Convert prototypes to ISO C90.
* except.c: Convert prototypes to ISO C90.
	* except.h: Likewise.
	* emit-rtl.c: Likewise.
	* et-forest.c: Likewise.
	* et-forest.h: Likewise.
	* except.c: Likewise.
	* explow.c: Likewise.
	* expmed.c: Likewise.
	* expr.c: Likewise.
	* expr.h: Likewise.

From-SVN: r68674
2003-06-29 18:21:58 +02:00
Ulrich Weigand 34dc173c2c except.c (EH_RETURN_STACKADJ_RTX): Do not define.
* except.c (EH_RETURN_STACKADJ_RTX): Do not define.
	(EH_RETURN_HANDLER_RTX): Likewise.
	(expand_builtin_eh_return): Do not copy stack adjustment
	if EH_RETURN_STACKADJ_RTX is not defined.
	(expand_eh_return): Likewise.  Also, do not pass stack
	adjustment as argument to the eh_return pattern.
	* except.h (MUST_USE_SJLJ_EXCEPTIONS): Do not define just
	because EH_RETURN_STACKADJ_RTX is not defined.
	* unwind-dw.c (uw_update_context_1): If EH_RETURN_STACKADJ_RTX
	is not defined, treat stack pointer like a regular register.
	(uw_init_context_1): Set up fake initial stack pointer register.
	(uw_install_context_1): Do not compute stack adjustment if
	EH_RETURN_STACKADJ_RTX is not defined.

	* config/i386/i386.md ("eh_return"): Remove first argument.
	* config/mips/mips.md ("eh_return"): Likewise.
	* config/rs6000/rs6000.md ("eh_return"): Likewise.
	* config/sh/sh.md ("eh_return"): Likewise.

	* config/s390/s390.h (EH_RETURN_STACKADJ_RTX): Remove.

From-SVN: r66672
2003-05-10 22:59:04 +00:00
Richard Henderson 9c80ff25b7 builtins.c (expand_builtin): Remove.
* builtins.c (expand_builtin) <BUILT_IN_DWARF_FP_REGNUM>: Remove.
        <BUILT_IN_DWARF_SP_COLUMN>: New.
        * builtins.def (BUILT_IN_DWARF_FP_REGNUM): Remove.
        (BUILT_IN_DWARF_SP_COLUMN): New.
        * dwarf2out.c (expand_builtin_dwarf_fp_regnum): Remove.
        (expand_builtin_dwarf_sp_column): New.
        * except.h: Update to match.
        * unwind-dw2.c (execute_stack_op): Correct stack push typo.
        (execute_cfa_program): Record location expression address
        before extracting length.
        (uw_update_context_1): Install old CFA into stack pointer column.
        (uw_init_context_1): Set cfa_reg to stack pointer column.

From-SVN: r66447
2003-05-03 22:22:51 -07:00
Mark Mitchell b2dd096b0c Makefile.in (calls.o): Depend on except.h.
* Makefile.in (calls.o): Depend on except.h.
	* calls.c: Include except.h.
	(emit_call_1): Call note_eh_region_may_contain_throw if
	appropriate.
	* except.c (eh_region): Add may_contain_throw.
	(expand_eh_region_end_cleanup): Do not include handler code when
	it cannot be reached.
	(note_eh_region_may_contain_throw): New function.
	* except.h (note_eh_region_may_contain_throw): New function.

	* call.c (build_over_call): Use build_cxx_call.
	(build_cxx_call): New method, split out of build_over_call.
	* cp-tree.h (language_function): Add can_throw.
	(build_cxx_call): Declare it.
	* decl.c (finish_function): If a function does not contain any
	calls to functions that can throw an exception, indicate that
	fact.
	* decl2.c (mark_used): Do not defer the instantiation of
	functions, if the current function does not throw.
	* optimize.c (maybe_clone_body): Copy TREE_NOTHROW to the clones.
	* pt.c (instantiate_decl): Make sure import_export_decl is called
	before emitting things.
	* rtti.c (throw_bad_cast): Use build_cxx_call.
	(build_dynamic_cast_1): Likewise.
	* typeck.c (build_function_call): Likewise.

	* g++.dg/template/recurse.C: Adjust location of error messages.

From-SVN: r65929
2003-04-22 05:44:12 +00:00
Matt Kraai af8294418c * except.h: Remove definition of varray_type.
From-SVN: r65074
2003-03-31 05:14:54 +00:00
Stuart Hastings b6128b8c31 function.h (struct function): Add flag all_throwers_are_sibcalls.
2002-08-24  Stuart Hastings  <stuart@apple.com>

        * function.h (struct function): Add flag
        all_throwers_are_sibcalls.
        * except.c (set_nothrow_function_flags): Replaces
        nothrow_function_p. Set new flag.
        * except.h (set_nothrow_function_flags): Replaces
        nothrow_function_p.
        * dwarf2out.c (struct dw_fde_struct): Add flag
        all_throwers_are_sibcalls.
        (output_call_frame_info): Test it.
        (dwarf2out_begin_prologue) Propagate it from cfun to
        dw_fde_struct.
        * toplev.c (rest_of_compilation): Update calls to
        nothrow_function_p.

From-SVN: r56561
2002-08-25 05:21:11 +00:00
Richard Henderson 6a58eee93d basic-block.h (flow_delete_block_noexpunge): Declare.
* basic-block.h (flow_delete_block_noexpunge): Declare.
	(expunge_block_nocompact): Declare.
	* cfg.c (expunge_block_nocompact): Split out from ...
	(expunge_block): ... here.
	* cfgrtl.c (can_delete_label_p): Don't use exception_handler_labels.
	(flow_delete_block_noexpunge): Split out from ...
	(flow_delete_block): ... here.
	* cfgcleanup.c (delete_unreachable_blocks): Compact while
	removing dead blocks.
	* except.c (exception_handler_labels): Remove.
	(exception_handler_label_map): New.
	(struct eh_region): Add aka member.
	(mark_ehl_map_entry, mark_ehl_map, free_region): New.
	(ehl_hash, ehl_eq, ehl_free, add_ehl_entry): New.
	(for_each_eh_label, for_each_eh_label_1): New.
	(init_eh): Register exception_handler_label_map.
	(free_eh_status): Use free_region.
	(find_exception_handler_labels): Use the map, not the list.
	(remove_exception_handler_label): Likewise.
	(maybe_remove_eh_handler): Likewise.
	(remove_eh_handler): Use the region aka bitmap.
	* except.h (exception_handler_labels): Remove.
	(for_each_eh_label): Declare.
	* jump.c (rebuild_jump_labels): Don't check exception_handler_labels.
	* loop.c (invalidate_loops_containing_label): New.
	(find_and_verify_loops): Use it.  Use for_each_eh_label.
	* sched-rgn.c (is_cfg_nonregular): Use
	current_function_has_exception_handlers.

From-SVN: r52100
2002-04-09 17:15:58 -07:00
Jason Merrill 659e5a7aa9 re PR c++/5636 (gcc-3.0.3, memory leakage: function that take a string as parameter will not call local variable destructors if exception is thrown.)
PR c++/5636
        * tree.h (CLEANUP_EH_ONLY): New macro.
        * stmt.c (expand_decl_cleanup_eh): New fn.
        (expand_cleanups): Check CLEANUP_EH_ONLY.
        * c-semantics.c (genrtl_decl_cleanup): Just take the CLEANUP_STMT.
        Use expand_decl_cleanup_eh.
        (expand_stmt): Adjust.
        * c-common.h: Adjust prototype.
        * cp/semantics.c (nullify_returns_r): Just set CLEANUP_EH_ONLY on
        cleanup for nrv.

        * except.c (struct eh_status): Remove protect_list.
        (begin_protect_partials, end_protect_partials): Remove.
        (add_partial_entry): Remove.
        * except.h: Remove prototypes.

        * expr.c (expand_expr) [WITH_CLEANUP_EXPR, TARGET_EXPR]: Use
        expand_decl_cleanup_eh.

cp/:
        * semantics.c (finish_eh_cleanup): New fn.
        * cp-tree.h: Add prototype.
        * init.c (perform_member_init, expand_cleanup_for_base): Use
        finish_eh_cleanup.
        * cp-tree.def (SUBOBJECT, CTOR_STMT): Remove.
        * cp-tree.h: Remove references.
        * decl.c (begin_constructor_body, end_constructor_body): Likewise.
        * dump.c (cp_dump_tree): Likewise.
        * pt.c (tsubst_expr): Likewise.
        * semantics.c (genrtl_ctor_stmt, genrtl_subobject): Remove.
        (cp_expand_stmt): Remove handling of CTOR_STMT and SUBOBJECT.
        * tree.c (cp_statement_code_p): Likewise.

        * init.c (build_new_1): Set CLEANUP_EH_ONLY on deleting cleanup.

From-SVN: r51827
2002-04-03 19:11:00 -05:00
Richard Henderson 93f82d6080 except.c (current_function_has_exception_handlers): New.
* except.c (current_function_has_exception_handlers): New.
        * except.h: Declare it.
        * sibcall.c (optimize_sibling_and_tail_recursive_call): Use it.
        Combine tests that disable all sibcalls for the function.

From-SVN: r51054
2002-03-19 16:49:13 -08:00
Graham Stott f9f6b7df9d attribs.c (handle_deprecated_attribute): constify WHAT.
* attribs.c (handle_deprecated_attribute): constify WHAT.
        * diagnostic.c (warn_deprecated_use): Add braces, fixes
        dangling else warning and constify WHAT.
        * except.h (struct function, struct inline_remap): Move
        struct tag forward defs before all prototypes.
        (duplicate_eh_regions): Whitespace.

From-SVN: r48799
2002-01-12 13:45:39 +00:00
Graham Stott b52155b696 except.h: Remove forward def of tree_node, rtx_def and define of tree, rtx.
* except.h: Remove forward def of tree_node, rtx_def and
        define of tree, rtx. Also remove undefs.

From-SVN: r48416
2001-12-31 05:44:58 +00:00
Joseph Myers a1f300c0f1 ChangeLog.0, [...]: Fix spelling errors.
* ChangeLog.0, ChangeLog.2, ChangeLog.3, ChangeLog.4, ChangeLog,
	FSFChangeLog.10, c-decl.c, cppfiles.c, cppinit.c, cpplex.c,
	cpplib.c, cppmain.c, cse.c, df.c, diagnostic.c, dominance.c,
	dwarf2out.c, dwarfout.c, emit-rtl.c, errors.c, except.c, except.h,
	explow.c, function.c, gcse.c, genrecog.c, predict.c, regmove.c,
	sched-rgn.c, ssa-ccp.c, stmt.c, toplev.c: Fix spelling errors.

From-SVN: r47279
2001-11-23 02:05:19 +00:00
Olivier Hainque 6d41a92f7c except.c: Support for catching a list of types with a single handler (struct eh_region):...
* except.c: Support for catching a list of types with a single handler
        (struct eh_region): Change type and filter to lists for catch regions.
        (mark_eh_region): Mark the filter list for GC also.
        (expand_start_catch): Always build a list if argument not NULL and
        register each type of the list through add_type_for_runtime.
        (duplicate_eh_region_1): Change type into type_list for catch regions.
        (assign_filter_values): Assign a filter to each type associated with a
        catch region. Assign filter for NULL types in a unique entry in the
        filter list.
        (build_post_landing_pads): Emit compare and jump for each filter of
        the list associated with a catch region.
        (reachable_next_level): When the type thrown is known, stop the search
        as soon as one type within a catch list matches. Also, a handler is
        potentially reachable only if at least one of the types it catches
        has not been previously caught.
        (collect_one_action_chain): Retrieve the filter for a NULL type list
        from the first filter list entry. For non NULL type lists, add an
        action record for every filter assigned.
        * except.h: Reflect changes in comment before expand_start_catch.

From-SVN: r47087
2001-11-16 07:48:18 -05:00
Joseph Myers ff7cc30768 ChangeLog.0, [...]: Fix spelling errors.
* ChangeLog.0, ChangeLog.1, ChangeLog.2, ChangeLog.3, ChangeLog.4,
	ChangeLog.5, ChangeLog, FSFChangeLog.10, FSFChangeLog.11,
	c-common.c, c-common.h, c-parse.in, c-typeck.c, cfg.c, config.gcc,
	configure, configure.in, except.c, except.h, flow.c, function.c,
	gcc.c, gcse.c, genrecog.c, libgcc2.c, loop.c, loop.h, params.def,
	predict.def, predict.h, reg-stack.c, regmove.c, sched-deps.c,
	sched-int.h, sibcall.c, ssa.c, stringpool.c, toplev.c, tree.c,
	unroll.c: Fix spelling errors.

From-SVN: r46595
2001-10-28 20:09:17 +00:00
Lars Brinkhoff 1322177dbd Makefile.in, [...]: replace "GNU CC" with "GCC".
* Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c,
	bitmap.h, builtin-types.def, builtins.c, builtins.def,
	c-aux-info.c, c-common.c, c-common.def, c-common.h,
	c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c,
	c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in,
	c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c,
	caller-save.c, calls.c, collect2.c, collect2.h, combine.c,
	conditions.h, config.gcc, configure.frag, configure.in,
	conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c,
	cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h,
	dependence.c, df.c, df.h, diagnostic.c, diagnostic.h,
	doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c,
	dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c,
	emit-rtl.c, errors.c, errors.h, except.c, except.h,
	exgettext, explow.c, expmed.c, expr.c, expr.h, final.c,
	fixproto, flags.h, flow.c, fold-const.c, fp-test.c,
	function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp,
	gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c,
	gencheck.c, gencodes.c, genconfig.c, genemit.c,
	genextract.c, genflags.c, gengenrtl.c, genmultilib,
	genopinit.c, genoutput.c, genpeep.c, genrecog.c,
	gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c,
	ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c,
	graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h,
	gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h,
	gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h,
	hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h,
	integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c,
	libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h,
	machmode.def, machmode.h, main.c, mbchar.c, mbchar.h,
	mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk,
	mkmap-symver.awk, optabs.c, output.h, params.c, params.def,
	params.h, predict.c, predict.def, predict.h, prefix.c,
	prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c,
	read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c,
	regclass.c, regmove.c, regrename.c, regs.h, reload.c,
	reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c,
	rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h,
	sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c,
	sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c,
	ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c,
	stringpool.c, system.h, timevar.c, timevar.def, timevar.h,
	tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h,
	tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
	unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h,
	unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c,
	xcoffout.h: replace "GNU CC" with "GCC".

From-SVN: r45105
2001-08-22 14:35:51 +00:00
Richard Henderson 84fc8b47f3 except.h (MUST_USE_SJLJ_EXCEPTIONS): Examine the value of DWARF2_UNWIND_INFO not just whether it is defined.
* except.h (MUST_USE_SJLJ_EXCEPTIONS): Examine the value of
        DWARF2_UNWIND_INFO not just whether it is defined.

From-SVN: r43829
2001-07-06 16:13:42 -07:00
Richard Henderson 86c9954991 except.c (get_exception_pointer, [...]): Take a struct function.
* except.c (get_exception_pointer, get_exception_filter): Take a
        struct function.  Update all callers.
        * except.h (get_exception_pointer): Update declaration.
        * expr.c (expand_expr): Update get_exception_pointer call.
        * integrate.c (expand_inline_function): Remap the exception pointer
        from callee to caller.

From-SVN: r43060
2001-06-08 15:57:23 -07:00
Richard Henderson 88657302b7 Standardize header guards.
From-SVN: r42615
2001-05-25 18:31:47 -07:00
Mark Mitchell e6855a2d29 except.h (protect_cleanup_actions): Remove it.
* except.h (protect_cleanup_actions): Remove it.
	(lang_protect_cleanup_actions): Declare it.
	* except.c (protect_cleanup_actions): Remove it.
	(lang_protect_cleanup_actions): New variable.
	(init_eh): Don't make protect_cleanup_actions a GC root.
	(expand_eh_region_and_cleanup): Call
	lang_protect_cleanup_actions.
	(output_function_exception_table): Remove unused `align'
	variable.
	* varasm.c (assemble_external): Abort if we have not yet
	opened the assembly output file.

	* except.c (cp_protect_cleanup_actions): New function.
	(init_exception_processing): Don't set protect_cleanup_actions
	here.  Do set lang_protect_cleanup_actions.

From-SVN: r42218
2001-05-17 18:12:27 +00:00
Richard Henderson 2a1ee410ce defaults.h (ASM_PREFERRED_EH_DATA_FORMAT): New.
* defaults.h (ASM_PREFERRED_EH_DATA_FORMAT): New.
	* dwarf2asm.c (dw2_force_const_mem, dw2_output_indirect_constant_1,
	dw2_output_indirect_constants, dw2_asm_output_encoded_addr_rtx): New.
	* dwarf2asm.h (dw2_asm_output_encoded_addr_rtx): Prototype.
	(dw2_output_indirect_constants): Prototype.
	* dwarf2out.c (dwarf2out_begin_prologue): Generate
	current_function_func_begin_label if we'll need it for EH.  Exit
	early for IA64_UNWIND_INFO.
	* except.c: Get DW_EH_PE_* defines from dwarf2.h.
	(eh_data_format_name): Update for indirect references.
	(output_function_exception_table): Care for IA64_UNWIND_INFO.
	Handle ASM_PREFERRED_EH_DATA_FORMAT.
	* except.h (MUST_USE_SJLJ_EXCEPTIONS): IA64_UNWIND_INFO needn't
	define HAVE_eh_return etc.
	* final.c (final_start_function): Always call dwarf2out_begin_prologue.
	(final_end_function): Don't call output_function_exception_table.
	* toplev.c (compile_file): Call dw2_output_indirect_constants.
	(rest_of_compilation): Invoke output_function_exception_table
	for ia64 before assemble_end_function.
	* tm.texi (ASM_PREFERRED_EH_DATA_FORMAT): Document.
	(ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Document.

	* unwind-dw2.c (_Unwind_GetTextRelBase, _Unwind_GetDataRelBase): New.
	* unwind.h: Declare them.
	* libgcc-std.ver: Export them.
	* unwind-pe.h: New file.

	* config/alpha/elf.h (ASM_PREFERRED_EH_DATA_FORMAT): New.

	* config/ia64/fde-glibc.c: Use "struct unw_table_entry"
	instead of "fde".
	(find_fde_for_dso): Extract DT_PLTGOT.
	(_Unwind_FindTableEntry): Rename from __ia64_find_fde; return
	the segment and gp as well.
	* config/ia64/frame-ia64.c: Remove file.
	* config/ia64/frame-ia64.h: Remove file.
	* config/ia64/unwind-ia64.c: New file.
	* config/ia64/unwind-ia64.h: New file.
	* config/ia64/ia64.h (ASM_OUTPUT_EH_CHAR): Remove.
	(ASM_OUTPUT_EH_SHORT, ASM_OUTPUT_EH_INT): Remove.
	(ASM_OUTPUT_EH_DOUBLE_INT): Remove.
	(ASM_PREFERRED_EH_DATA_FORMAT): New.
	(ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): New.
	(IA64_UNWIND_INFO): Re-enable.
	(HANDLER_SECTION): Remove.
	(EH_RETURN_DATA_REGNO): New.
	* config/ia64/ia64.md (exception_receiver): Remove.
	* config/ia64/t-glibc (LIB2ADDEH): Re-enable.
	* config/ia64/t-ia64 (LIB2ADDEH): Re-enable.

From-SVN: r41981
2001-05-11 23:03:20 -07:00
Andreas Jaeger 02d208ff0f except.h: Add prototype declaration for expand_builtin_init_dwarf_reg_sizes.
* except.h: Add prototype declaration for
	expand_builtin_init_dwarf_reg_sizes.

From-SVN: r41823
2001-05-04 06:58:46 +02:00
Richard Henderson 847abd1f89 except.h (lang_eh_type_covers): Mark extern.
* except.h (lang_eh_type_covers): Mark extern.
        (lang_eh_runtime_type): Likewise.

From-SVN: r41024
2001-04-02 16:23:34 -07:00
Richard Henderson efc4565875 * except.h (expand_builtin_dwarf_fp_regnum): Declare.
From-SVN: r40995
2001-04-01 23:36:33 -07:00
Richard Henderson 52a11cbfcf IA-64 ABI Exception Handling.
From-SVN: r40924
2001-03-28 03:04:51 -08:00
Richard Henderson 54590688b5 except.c (can_throw_internal): Rename from can_throw.
* except.c (can_throw_internal): Rename from can_throw.
        * except.h, resource.c: Update references.

From-SVN: r40913
2001-03-27 23:29:21 -08:00
Richard Henderson 894d0e3925 except.h (flag_non_call_exceptions): Move ...
* except.h (flag_non_call_exceptions): Move ...
        * flags.h: ... here.

From-SVN: r40906
2001-03-27 21:38:40 -08:00
Richard Henderson 531073e70e Make -fsjlj-exceptions a configure option.
From-SVN: r40905
2001-03-27 21:24:24 -08:00
Richard Henderson c1e9f66309 bb-reorder.c, [...]: Rename asynchronous_exceptions to flag_non_call_exceptions.
* bb-reorder.c, dwarf2out.c, except.c, except.h, flow.c,
        jump.c, toplev.c:
        Rename asynchronous_exceptions to flag_non_call_exceptions.

        * java/decl.c (end_java_method): Rename asynchronous_exceptions to
        flag_non_call_exceptions.

From-SVN: r40902
2001-03-27 20:18:13 -08:00
Richard Henderson d80eb1e167 Makefile.in (resource.o): Depend on except.h.
* Makefile.in (resource.o): Depend on except.h.
        * except.h (output_exception_table_data): Prototype.
        * genconfig.c (gen_peephole2): Prototype.
        * genemit.c (main): Include ggc.h.
        * genoutput.c: Revert parts of last change: include errors.h
        (main): Set progname.
        * recog.c: Include hard-reg-set.h before recog.h.
        * resource.c: Include except.h.

From-SVN: r34219
2000-05-27 19:17:59 -07:00
Mark Mitchell 0519ce3019 except.h (can_throw): Declare it.
* except.h (can_throw): Declare it.
	* except.c (can_throw): Give it external linkage.
	* resource.c (find_dead_or_set_registers): Use can_throw.

From-SVN: r34178
2000-05-25 23:43:43 +00:00
Andrew MacLeod ce152ef836 except.c (func_eh_entry): Add emitted field.
2000-05-25  Andrew MacLeod  <amacleod@cygnus.com>
            Andrew Haley  <aph@cygnus.com>

	* except.c  (func_eh_entry): Add emitted field.
	(new_eh_region_entry): Set emitted field to 0;
	(output_exception_table_entry): Only emit previously un-emitted data,
	and send it to the eh_data section.
	(output_exception_table): Break out common parts. Output
	exception table for entire compilation unit to eh_data section.
	(output_exception_table_data): Common parts of output_exception_table.
	Send output to eh_data section.
	(output_function_exception_table): Output exception table data for
	a single function to eh_data section.
	(free_exception_table): New external to free the table.
	* except.h (free_exception_table): Add prototype.
	(output_function_exception_table): Add prototype.
	* final.c (final_end_function): Output function exception table
	for IA64_UNWIND_INFO.
	(final_scan_insn): Emit any unwind directives for an insn.

	* frame-dwarf2.c: New file containing all DWARF 2 specific code
	from frame.c.
	* frame.c: Remove all DWARF 2 specific code.
	* config/ia64/frame-ia64.c: New file.
	(gthread_stuff): Make all gthread available with
	IA64_UNWIND_INFO.
	(dwarf_fde): Define an IA64 struct for dwarf_fde.
	(__register_frame_info, __register_frame): Move to common area of file.
	(__register_frame_info_table, __register_frame_table): Move to common i
	area.
	(__deregister_frame_info, __deregister_frame): Move to common area.
	(__frame_init, find_fde): New versions for IA64_UNWIND_INFO.
	(read_uleb128): New version for ia64.
	(get_unwind_record): Read the next IA-64 unwind record.
	(read_R_record): Read a region header record.
	(process_a_b_reg_code): X record helper.
	(read_X_record): Read an X format record.
	(read_B_record): Read a B format record.
	(P3_record_types): List of record types matching the P3 format.
	(P7_record_types): List of record types matching the P7 format.
	(P8_record_types): List of record types matching the P8 format.
	(read_P_record): Read a P format record.
	(init_ia64_reg_loc): Set default fields for a register.
	(init_ia64_unwind_frame): Set defaults for all register records.
	(execute_one_ia64_descriptor): Execute one descriptor record.
	(rse_address_add): Calculate the position of a local reg in memory.
	(normalize_reg_loc): Turn a location descriptor into a memory address.
	(maybe_normalize_reg_loc): Only normalize a descriptor if it falls
	within a specified PC offset range.
	(get_real_reg_value): Given a register location, retrieve its value.
	(set_real_reg_value): Change the value of a register location.
	(copy_reg_value): Copy reg values, if needed.
	(copy_saved_reg_state): Copy all registers that need to be copied.
	(process_state_between): Normalize all frame register records that
	fall within the specified PC range.
	(frame_translate): Take a processed frame description, and turn
	everything into addresses.
	(build_ia64_frame_state ): Find and create frame state record for a PC.
	(get_personality): Get the personality routine for a given frame.
	(get_except_table): Get the exception table for a given frame.
	(record_name): Unwind record names for debugging.
	(print_record): Print and unwind record.
	(print_all_records): Print an entire unwind image.
	(__ia64_backtrace): Print a backtrace.
	(ia64_backtrace_helper): New function.
	(__register_frame_info_aux): New function.
	* config/ia64/crtend.asm (__do_frame_setup_aux): New function.

	* frame.h (enum unw_record_type): New unwind record types.
	(struct unw_p_record, unw_b_record, unw_x_record) : New unwind records.
	(struct unw_r_record, unwind_record): New unwind record structs.
	(struct unwind_info_ptr): Unwind information layout.
	(IA64_UNW_LOC_TYPE_*): Macros for different types for location
	descriptors.
	(struct ia64_reg_loc): Register location description.
	(struct ia64_frame_state): Location of all registers in a frame.
	(struct object): Add pc_base and fde_end for IA64_UNWIND_INFO.
	* libgcc2.c (__ia64_personality_v1): Personality routine.
	(__calc_caller_bsp): Calculate the bsp register for the caller's
	frame.
	(ia64_throw_helper): Figure out who to return to and set up the
	registers.
	(__throw): Throw routine.

	* output.h (assemble_eh_align, assemble_eh_label): New functions
	to generate EH info where we want it.
	(assemble_eh_integer): New function.
	* toplev.c (compile_file): Output module level exception table for
	non-ia64 targets.
	(main): Set exceptions_via_longjump and flag_new_exceptions based
	on IA64_UNWIND_INFO too.

	* varasm.c (assemble_eh_label): Generate a label via
	ASM_OUTPUT_EH_LABEL if it has been specified.
	(assemble_eh_align): Generate an alignment directive via
	ASM_OUTPUT_EH_ALIGN if it has been specified.
	(assemble_eh_label): Generate an integer value via
	ASM_OUTPUT_EH_type if they have been specified.
	* config/ia64/ia64.c (rtx_needs_barrier): Add flushrs.
	(ia64_init_builtins): Add __builtin_ia64_bsp
	and __builtin_ia64_flushrs.
	(ia64_expand_builtin): Add IA64_BUILTIN_BSP and
	IA64_BUILTIN_FLUSHRS.
	* config/ia64/ia64.h (ia64_builtins): Add IA64_BUILTIN_BSP and
	IA64_BUILTIN_FLUSHRS.

	* config/ia64/ia64.md (flushrs): New insn to flush the register
	stack.  Add to unspec list.

	* config/ia64/crtbegin.asm (frame_object): Change size.
	(__do_frame_setup_aux): New function.
	* config/ia64/crtend.asm: call __do_frame_setup_aux.
	* config/ia64/t-ia64 (LIB2ADDEH): Add.
	* Makefile.in (LIB2ADDEH): Add.
	(LIB2ADD): Use LIB2ADDEH.

Co-Authored-By: Andrew Haley <aph@cygnus.com>

From-SVN: r34169
2000-05-25 15:21:51 +00:00
Martin v. Löwis c14f7160a1 emit-rtl.c (push_to_full_sequence, [...]): New functions.
* emit-rtl.c (push_to_full_sequence, end_full_sequence): New functions.
	* except.c (emit_cleanup_handler): Use them.
	(expand_end_all_catch): Likewise.
	* function.c (fixup_var_refs): Likewise.
	(expand_function_end): Clear catch_clauses_last.
	* rtl.h (push_to_full_sequence, end_full_sequence): Declare.
	* except.h (struct eh_status): New field x_catch_clauses_last.
	(catch_clauses_last): New define.

	* cp/except.c (expand_exception_blocks): Clear catch_clauses_last.

	* java/except.c (emit_handlers): Clear catch_clauses_last.

From-SVN: r32643
2000-03-19 18:25:27 +00:00
Jason Merrill fb13d4d024 except.c (can_throw): See through a SEQUENCE.
* except.c (can_throw): See through a SEQUENCE.
        (nothrow_function_p): New fn.
        * except.h: Declare it.
        * function.c (current_function_nothrow): New var.
        (prepare_function_start): Initialize it.
        * output.h: Declare it.
        * toplev.c (rest_of_compilation): Set it.
        * dwarf2out.c (dwarf2out_begin_prologue): Use it.

From-SVN: r32449
2000-03-09 14:01:47 -05:00
Jeff Law ef58a5234d Copyright fixes.
From-SVN: r32174
2000-02-25 23:04:48 -07:00
Kaveh R. Ghazi 711d877c9e eh-common.h: PROTO -> PARAMS.
* eh-common.h: PROTO -> PARAMS.
	* emit-rtl.c: Likewise.
	* errors.c: Likewise.
	* errors.h: Likewise.
	* except.c: Likewise.
	* except.h: Likewise.
	* explow.c: Likewise.
	* expmed.c: Likewise.
	* expr.c: Likewise.
	* expr.h: Likewise.
	* final.c: Likewise.
	* fix-header.c: Likewise.
	* flow.c: Likewise.
	* fold-const.c: Likewise.
	* function.c: Likewise.
	* function.h: Likewise.
	* gcc.c: Likewise.
	* gcov-io.h: Likewise.
	* gcov.c: Likewise.
	* gcse.c: Likewise.

From-SVN: r31419
2000-01-14 17:14:43 +00:00
Bernd Schmidt 01d939e8fb current_function -> cfun
From-SVN: r31033
1999-12-20 13:18:17 +00:00
Mark Mitchell f54a7f6fe2 except.h (struct eh_queue): Add `next' pointer.
* except.h (struct eh_queue): Add `next' pointer.
	(struct eh_status): Make x_ehqueue a pointer.
	(push_ehqueue):  Declare.
	(pop_ehqueue): Likewise.
	* except.c (expand_eh_region_end): Adjust now that ehqueue is a
	pointer.
	(expand_fixup_region_end): Likewise.
	(expand_leftover_cleanups): Likewise.
	(push_ehqueue): Define.
	(pop_ehqueue): Likewise.
	(emit_cleanup_handler): Use push_ehqueue and pop_ehqueue rather
	than doing it inline.
	(expand_start_all_catch):  Adjust now that ehqueue is a
	pointer.
	(mark_eh_queue): Mark all level of the queue.
	(mark_eh_status):  Adjust now that ehqueue is a
	pointer.
	(init_eh_for_function): Allocate ehqueue.
	(free_eh_status): Free it.
	* stmt.c (expand_cleanups): Save the ehqueue around the cleanup
	expansion for a fixup.

From-SVN: r30874
1999-12-12 18:32:36 +00:00
Mark Mitchell 76fc91c7c8 except.h (eh_status): Adjust documentation for x_protect_list.
* except.h (eh_status): Adjust documentation for x_protect_list.
	(begin_protect_partials): New function.
	* except.c (enqueue_eh_entry): Fix formatting.
	(get_first_handler): Add consistency check.
	(add_partial_entry): Adjust usage of protect_list.
	(emit_cleanup_handler): Save and restore ehqueue.
	(expand_start_all_catch): Add comment.
	(begin_protect_partials): New function.
	(end_protect_partials): Adjust usage of protect_list.
	(init_eh_for_function): Use xcalloc.

From-SVN: r30667
1999-11-25 19:21:27 +00:00
Mark Mitchell 1e4ceb6f9e except.h (struct eh_entry): Add goto_entry_p.
* except.h (struct eh_entry): Add goto_entry_p.
	(eh_region_from_symbol): Remove prototype.
	* except.c (find_func_region_from_symbol): New function.
	(emit_cleanup_handler): Likewise.
	(eh_region_from_symbol): Make it static.
	(add_new_handler): Verify the argument.
	(find_func_region): Update comment.
	(expand_eh_region_end): Expand handlers here, rater than waiting
	until expand_leftover_cleanups or start_all_catch.
	(expand_leftover_cleanups): Don't expand here.
	(expand_start_all_catch): Or here.
	(expand_rethrow): Check the return value from find_func_region.
	* function.c (expand_function_end): Emit the catch_clauses.

From-SVN: r30576
1999-11-18 17:50:56 +00:00
Bernd Schmidt d9d5c9de1c Use lookup table to get register sizes in dwarf2 eh
From-SVN: r29730
1999-09-30 13:40:41 +00:00
Andrew MacLeod 1ef1bf063b except.h (eh_nesting_info): Add new structure defintion.
Tue Aug 10 10:47:42 EDT 1999  Andrew MacLeod  <amacleod@cygnus.com>

	* except.h (eh_nesting_info): Add new structure defintion.
	(init_eh_nesting_info, free_eh_nesting_info): Add function prototypes.
	(reachable_handlers, update_rethrow_references): Add function
	prototypes.
	* rtl.h (struct rtvec_def): Update comments.  REG_EH_RETHROW takes
	a rethrow symbol instead of an integer exception region number.
	* flow.c (Make_edges): Use new exception nesting routines to determine
	which handlers are reachable from a CALL or asynchronous insn.
	Dont add an edge for calls with a REG_EH_REGION of -1 to non-local
	goto receivers.
	(delete_eh_regions): Update rethrow labels, and don't delete
	regions which are the target of a rethrow.
	* except.c (struct func_eh_entry): Add rethrow_ref field, now we can
	avoid overloading the SYMBOL_REF_USED flag.
	(rethrow_symbol_map): Use new rethrow_ref field.
	(rethrow_used): Use new rethrow_ref field.
	(expand_rethrow): REG_EH_RETHROW now has a SYMBOL_REF instead
	of an integer.  Fix formatting.
	(output_exception_table_entry): Use new rethrow_ref field.
	(can_throw): Check for EH_REGION_NOTE before deciding
	whether a CALL can throw or not.
	(scan_region): Call rethrow_used() instead of accessing data structure.
	(update_rethrow_references): New function to make sure only regions
	which are still targets of a rethrow are flagged as such.
	(process_nestinfo): New static function to initialize a handler
	list for a specific region.
	(init_eh_nesting_info): New function to allocate and initialize
	the list of all EH handlers reachable from all regions.
	(reachable_handlers): New function to retrieve the list of handlers
	reachable from a specific region and insn.
	(free_eh_nesting_info): New function to dispose of a list of
	reachable handlers.

From-SVN: r28647
1999-08-10 16:19:16 +00:00
Bernd Schmidt b384405b34 Backport of GC branch patches part 1: kill eh status saving.
From-SVN: r28357
1999-07-31 12:46:53 +00:00
Jeff Law 4283012f9f Copyright fixes.
From-SVN: r24535
1999-01-06 13:44:41 -07:00
Andrew MacLeod 0177de8737 except.h (struct handler_info): Add handler_number field
* except.h (struct handler_info): Add handler_number field
	* except.c (gen_exception_label): EH labels no longer need to be
	on the permanent obstack.
	(get_new_handler): Set the label number field.
	(output_exception_table_entry): Regenerate handler label reference
	from the label number field.
	(init_eh): Remove a blank line
	* integrate.c (get_label_from_map): Labels no longer need to be
	on the permanent obstack.

From-SVN: r24203
1998-12-09 06:15:20 +00:00
Andrew MacLeod e6cfb550ab See ChangeLog..
Tue Dec  8 15:32:56 EST 1998  Andrew MacLeod  <amacleod@cygnus.com>
See ChangeLog.. These are the files that were changed:
	* eh-common.h (struct eh_context): Add table_index for rethrows.
	* rtl.h (enum reg_note): Add REG_EH_REGION and REG_EH_RETHROW reg notes.
	* rtl.c (reg_note_name): Add strings for new reg_note enums.
	* expr.h (rethrow_libfunc): New library decl.
	* optabs.c (rethrow_libfunc): Initialize.
	* except.h (struct eh_entry): Add new field 'rethrow_label'.
	* except.c (create_rethrow_ref): New function to create a single
	* flow.c (make_edges): Add different edges for rethrow calls,
	* integrate.c (save_for_inline_eh_labelmap): New callback routine to
	* libgcc2.c (find_exception_handler): Generalize to enable it to
        * cp/except.c
        * cp/exception.cc

From-SVN: r24194
1998-12-08 14:04:03 +00:00
Richard Henderson 710384268d tree.h (BUILT_IN_CALLER_RETURN_ADDRESS): Unused.
* tree.h (BUILT_IN_CALLER_RETURN_ADDRESS): Unused.  Kill.
	(BUILT_IN_FP, BUILT_IN_SP, BUILT_IN_SET_RETURN_ADDR_REG): Kill.
	(BUILT_IN_EH_STUB_OLD, BUILT_IN_EH_STUB, BUILT_IN_SET_EH_REGS): Kill.
	(BUILT_IN_EH_RETURN, BUILT_IN_DWARF_CFA): New.
	* c-decl.c (init_decl_processing): Update accordingly.
	* expr.c (expand_builtin): Likewise.
	* cp/decl.c (init_decl_processing): Likewise.
	* rtl.h (global_rtl): Add cfa entry.
	(virtual_cfa_rtx, VIRTUAL_CFA_REGNUM): New.
	(LAST_VIRTUAL_REGISTER): Update.
	* emit-rtl.c (global_rtl): Add cfa entry.
	(init_emit): Initialize it.
	* function.c (cfa_offset): New.
	(instantiate_virtual_regs): Initialize it.
	(instantiate_virtual_regs_1): Instantiate virtual_cfa_rtx.
	(expand_function_end): Call expand_eh_return.
	* tm.texi (ARG_POINTER_CFA_OFFSET): New.
	* except.c (current_function_eh_stub_label): Kill.
	(current_function_eh_old_stub_label): Likwise; update all references.
	(expand_builtin_set_return_addr_reg): Kill.
	(expand_builtin_eh_stub_old, expand_builtin_eh_stub): Kill.
	(expand_builtin_set_eh_regs): Kill.
	(eh_regs): Produce a third reg for the actual handler address.
	(eh_return_context, eh_return_stack_adjust): New.
	(eh_return_handler, eh_return_stub_label): New.
	(init_eh_for_function): Initialize them.
	(expand_builtin_eh_return, expand_eh_return): New.
	* except.h: Update prototypes.
	* flow.c (find_basic_blocks_1): Update references to the stub label.
	* function.h (struct function): Kill stub label elements.
	* libgcc2.c (in_reg_window): For REG_SAVED_REG, check that the
	register number is one that would be in the previous window.
	Provide a dummy definition for non-windowed targets.
	(get_reg_addr): New function.
	(get_reg, put_reg, copy_reg): Use it.
	(__throw): Rely on in_reg_window, not INCOMING_REGNO.  Kill stub
	generating code and use __builtin_eh_return.  Use __builtin_dwarf_cfa.
	* alpha.c (alpha_eh_epilogue_sp_ofs): New.
	(alpha_init_expanders): Initialize it.
	(alpha_expand_epilogue): Use it.
	* alpha.h: Declare it.
	* alpha.md (eh_epilogue): New.
	* m68h.h (ARG_POINTER_CFA_OFFSET): New.
	* sparc.h (ARG_POINTER_CFA_OFFSET): New.

From-SVN: r22436
1998-09-15 12:19:12 -07:00