Commit Graph

67 Commits

Author SHA1 Message Date
Kaveh R. Ghazi 5f754896d3 c-lex.c (c_lex_with_flags, lex_string): Constify.
* c-lex.c (c_lex_with_flags, lex_string): Constify.
	* c-ppoutput.c (print_line, pp_dir_change): Likewise.
	* c-typeck.c (free_all_tagged_tu_seen_up_to): Likewise.
	* cfg.c (bb_copy_original_hash, bb_copy_original_eq): Likewise.
	* cfgloop.c (loop_exit_hash, loop_exit_eq): Likewise.
	* ddg.c (compare_sccs): Likewise.
	* df-scan.c (df_ref_compare, df_mw_compare): Likewise.
	* dfp.c (decimal_real_from_string, decimal_to_decnumber,
	decimal_to_binary, decimal_do_compare, decimal_real_to_decimal,
	decimal_do_fix_trunc, decimal_real_to_integer,
	decimal_real_to_integer2, decimal_real_maxval): Likewise.
	* dse.c (const_group_info_t): New.
	(invariant_group_base_eq, invariant_group_base_hash): Constify.
	* dwarf2out.c (const_dw_die_ref): New.
	(decl_die_table_hash, decl_die_table_eq, file_info_cmp): Constify.
	* tree-browser.c (TB_parent_eq): Likewise.
	* unwind-dw2-fde.c (__register_frame_info_bases,
	__deregister_frame_info_bases, fde_unencoded_compare, fde_split,
	add_fdes, linear_search_fdes, binary_search_unencoded_fdes):
	Likewise.
	* unwind-dw2-fde.h (get_cie, next_fde): Likewise.
	* unwind-dw2.c (uw_frame_state_for): Likewise.
	* value-prof.c (histogram_hash, histogram_eq): Likewise.
	* value-prof.h (const_histogram_value): New.

From-SVN: r126920
2007-07-25 18:14:57 +00:00
Geoffrey Keating ca0d5e024b * unwind-dw2.c (uw_identify_context): Use the CFA, not the IP.
From-SVN: r124837
2007-05-18 22:50:18 +00:00
Geoffrey Keating 9dc5c4f5eb * unwind-dw2.c (execute_stack_op): Handle DW_OP_swap.
From-SVN: r121165
2007-01-25 07:08:33 +00:00
Andreas Krebbel f767122b2e unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24  Andreas Krebbel  <krebbel1@de.ibm.com>

	* unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with 
	_uleb128_t and _Unwind_SWord with _sleb128_t.
	* unwind-dw2.c (extract_cie_info, execute_stack_op, execute_cfa_program,
	uw_frame_state_for, uw_update_context_1): Likewise.
	* unwind-c.c (parse_lsda_header, PERSONALITY_FUNCTION): Likewise.
	* unwind-pe.h (read_uleb128, read_sleb128,
	read_encoded_value_with_base): Likewise.
	* unwind-generic.h: Define _sleb128_t and _uleb128_t types.

2007-01-24  Andreas Krebbel  <krebbel1@de.ibm.com>

	* libsupc++/eh_personality.cc (parse_lsda_header, check_exception_spec,
	get_ttype_entry, empty_exception_spec, PERSONALITY_FUNCTION): Replaced
	_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.

2007-01-24  Andreas Krebbel  <krebbel1@de.ibm.com>

	* exception.cc (parse_lsda_header, PERSONALITY_FUNCTION): Replaced
	_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.

From-SVN: r121116
2007-01-24 14:46:47 +00:00
Jakub Jelinek f8e7718c6f unwind-dw2.c (SIGNAL_FRAME_BIT, [...]): Define.
* unwind-dw2.c (SIGNAL_FRAME_BIT, EXTENDED_CONTEXT_BIT): Define.
	(struct _Unwind_Context): Rename args_size to flags, remove
	signal_frame field, add a new args_size field and version field.
	(_Unwind_IsSignalFrame, _Unwind_SetSignalFrame,
	_Unwind_IsExtendedContext): New inline functions.
	(_Unwind_GetGR, _Unwind_SetGR, _Unwind_GetGRPtr, _Unwind_SetGRPtr):
	Assume by_value array is only present if _Unwind_IsExtendedContext.
	(_Unwind_GetIPInfo, execute_cfa_program, uw_frame_state_for): Use
	_Unwind_IsSignalFrame.
	(__frame_state_for): Initialize context.flags to EXTENDED_CONTEXT_BIT.
	(uw_update_context_1): Use _Unwind_SetSignalFrame.
	(uw_init_context_1): Initialize context->flags to
	EXTENDED_CONTEXT_BIT.
	* config/rs6000/linux-unwind.h (frob_update_context): Use
	_Unwind_SetSignalFrame.

From-SVN: r120406
2007-01-04 00:45:47 +01:00
J"orn Rennecke 7bec3e8418 unwind-dw2.c (uw_init_context_1): Fix test that checks if dwarf_reg_size_table has been initialized.
* unwind-dw2.c (uw_init_context_1): Fix test that checks if
	dwarf_reg_size_table has been initialized.

From-SVN: r118188
2006-10-30 17:55:33 +00:00
Nathan Froyd 6673f90bc6 unwind-dw2.h: Move cfa-related variables into struct frame_state_reg_info to ensure that the...
* gcc/unwind-dw2.h: Move cfa-related variables into
	struct frame_state_reg_info to ensure that the CFA is properly
	handled when executing DW_CFA_{remember,restore}_state.
	* gcc/unwind-dw2.c, gcc/config/alpha/linux-unwind.h,
	gcc/config/alpha/vms-unwind.h, gcc/config/s390/tpf-unwind.h
	gcc/config/s390/linux-unwind.h, gcc/config/sparc/linux-unwind.h
	gcc/config/i386/linux-unwind.h, gcc/config/sh/linux-unwind.h
	gcc/config/rs6000/linux-unwind.h,
	gcc/config/rs6000/darwin-fallback.c, gcc/config/pa/linux-unwind.h,
	gcc/config/pa/hpux-unwind.h, gcc/config/mips/linux-unwind.h:
	Modify to use new cfa_* fields.

From-SVN: r118068
2006-10-26 19:31:09 +00:00
John David Anglin edbaf6a24d unwind-dw2.c: Add declarations for uw_update_context and uw_frame_state_for.
* unwind-dw2.c: Add declarations for uw_update_context and
	uw_frame_state_for.
	* pa/hpux-unwind.h (pa_fallback_frame_state): When an export stub is
	detected, advance frame state and context once to skip over stub.

From-SVN: r113865
2006-05-17 15:35:36 +00:00
Kazu Hirata c0220ea4c5 builtins.c, [...]: Fix comment typos.
* builtins.c, c-pragma.h, c-typeck.c, cgraph.c, cgraphunit.c,
	combine.c, common.opt, config/dfp-bit.c, config/i386/i386.c,
	config/m68k/m68k.c, config/m68k/m68k.md, config/mt/mt.c,
	config/mt/mt.h, config/s390/s390.md, df-core.c, df-problems.c,
	df-scan.c, df.h, diagnostic.c, expr.c, function.h, gimplify.c,
	loop-invariant.c, omp-low.c, opts.c, passes.c,
	rtl-factoring.c, rtlanal.c, struct-equiv.c, tree-cfgcleanup.c,
	tree-ssa-loop-niter.c, tree-ssa-loop-prefetch.c,
	tree-ssa-structalias.c, tree-ssa-threadedge.c,
	tree-ssa-threadupdate.c, tree-vect-patterns.c,
	tree-vect-transform.c, tree-vectorizer.h, tree-vrp.c,
	unwind-dw2.c: Fix comment typos.  Follow spelling conventions.

From-SVN: r111721
2006-03-04 23:05:24 +00:00
Jakub Jelinek 4469af7acf unwind-dw2.h (_Unwind_FrameState): Add REG_SAVED_VAL_OFFSET and REG_SAVED_VAL_EXP constants.
* unwind-dw2.h (_Unwind_FrameState): Add REG_SAVED_VAL_OFFSET
	and REG_SAVED_VAL_EXP constants.
	* unwind-dw2.c (struct _Unwind_Context): Add by_value array.
	(_Unwind_GetGR, _Unwind_SetGR, _Unwind_GetGRPtr, _Unwind_SetGRPtr):
	Handle regs stored by value.
	(_Unwind_SetGRValue, _Unwind_GRByValue): New functions.
	(execute_cfa_program): Handle DW_CFA_val_offset,
	DW_CFA_val_offset_sf and DW_CFA_val_expression.
	(uw_update_context_1): Handle REG_SAVED_REG with regs stored by
	value specially.  Handle REG_SAVED_VAL_OFFSET and REG_SAVED_VAL_EXP.
	(uw_install_context_1): Handle target regs stored by value.

	* gcc.target/i386/cleanup-1.c: New test.
	* gcc.target/i386/cleanup-2.c: New test.

From-SVN: r111705
2006-03-04 08:07:12 +01:00
Jakub Jelinek 754e45a867 re PR other/26208 (Serious problem with unwinding through signal frames)
PR other/26208
	* unwind-dw2.c (struct _Unwind_Context): Add signal_frame field.
	(extract_cie_info): Handle S flag in augmentation string.
	(execute_cfa_program): If context->signal_frame, execute also
	fs->pc == context->ra instructions.
	(uw_frame_state_for): If context->signal_frame, don't subtract one
	from context->ra to find FDE.
	(uw_update_context_1): Set context->signal_frame to
	fs->signal_frame.
	(_Unwind_GetIPInfo): New function.
	* unwind-dw2.h (_Unwind_FrameState): Add signal_frame field.
	* unwind-c.c (PERSONALITY_FUNCTION): Use _Unwind_GetIPInfo instead
	of _Unwind_GetIP.
	* unwind-sjlj.c (_Unwind_GetIPInfo): New function.
	* unwind-generic.h (_Unwind_GetIPInfo): New prototype.
	* unwind-compat.c (_Unwind_GetIPInfo): New function.
	* libgcc-std.ver (_Unwind_GetIPInfo): Export @@GCC_4.2.0.
	* config/ia64/unwind-ia64.c (_Unwind_GetIPInfo): New function.
	* config/arm/unwind-arm.h (_Unwind_GetIPInfo): Define.
	* config/i386/linux-unwind.h (x86_fallback_frame_state,
	x86_64_fallback_frame_state): Set fs->signal_frame.
	* config/rs6000/linux-unwind.h (ppc_fallback_frame_state): Likewise.
	(MD_FROB_UPDATE_CONTEXT): Define unconditionally.
	(frob_update_context): Likewise.  Workaround missing S flag in
	Linux 2.6.12 - 2.6.16 kernel vDSOs.
	* config/s390/linux-unwind.h (s390_fallback_frame_state): Likewise.
	Remove the psw_addr + 1 hack.
libjava/
	* exception.cc (PERSONALITY_FUNCTION): Use _Unwind_GetIPInfo instead
	of _Unwind_GetIP.
	* include/i386-signal.h (MAKE_THROW_FRAME): Change into empty macro.
	(HANDLE_DIVIDE_OVERFLOW): Don't adjust _res->eip if falling through
	to throw.
	* include/x86_64-signal.h (MAKE_THROW_FRAME): Change into empty
	macro.
	* include/powerpc-signal.h (MAKE_THROW_FRAME): Change into empty
	macro.
libstdc++-v3/
	* libsupc++/eh_personality.cc (PERSONALITY_FUNCTION): Use
	_Unwind_GetIPInfo instead of _Unwind_GetIP.

From-SVN: r111488
2006-02-27 18:26:26 +01:00
Richard Henderson f6672e8e52 dwarf2out.c (dw_cfi_oprnd_struct): Reduce dw_cfi_reg_num to int.
* dwarf2out.c (dw_cfi_oprnd_struct): Reduce dw_cfi_reg_num to int.
        (lookup_cfa_1): Apply data alignment to DW_CFA_def_cfa_offset_sf
        and DW_CFA_def_cfa_sf.
        (def_cfa_1): Use DW_CFA_def_cfa_offset_sf with negative values.
        (dbx_reg_number): Don't assert particular registers here.
        (based_loc_descr): ... do it here instead.  Fold in ...
        (eliminate_reg_to_offset): ... this function.
        (compute_frame_pointer_to_cfa_displacement): Fold in the effects
        of eliminate_reg_to_offset; use FRAME_POINTER_CFA_OFFSET.
        * unwind-dw2.c (execute_cfa_program): Apply data align factor
        to DW_CFA_def_cfa_offset_sf and DW_CFA_def_cfa_sf.
        * function.c (instantiate_new_reg): Use FRAME_POINTER_CFA_OFFSET.
        (instantiate_virtual_regs): Likewise.
        * var-tracking.c (adjust_stack_reference): Likewise.
        * doc/tm.texi (FRAME_POINTER_CFA_OFFSET): New.

From-SVN: r107154
2005-11-17 17:19:10 -08:00
Daniel Jacobowitz 60aef23e38 unwind-ia64.c (uw_advance_context): New.
* config/ia64/unwind-ia64.c (uw_advance_context): New.  Call
	uw_update_context.
	* unwind-dw2.c (uw_advance_context): Likewise.
	* unwind-sjlj.c (uw_advance_context): Likewise.  Also call
	_Unwind_SjLj_Unregister.
	* unwind.inc (_Unwind_ForcedUnwind_Phase2): Call uw_advance_context.

From-SVN: r107103
2005-11-16 22:10:39 +00:00
Kelley Cook 366ccddb2b Update FSF address.
From-SVN: r101317
2005-06-25 02:02:01 +00:00
Nathan Sidwell 950ccbc491 unwind-dw2-fde-darwin.c (examine_objects): Fix aliasing in read_encoded_value_with_base call.
* unwind-dw2-fde-darwin.c (examine_objects): Fix aliasing in
	read_encoded_value_with_base call.
	* unwind-dw2-fde-glibc.c (_Unwind_IteratePhdrCallback): Likewise.
	* unwind-dw2-fde.c (_Unwind_Find_FDE): Likewise.
	* unwind-dw2.c (extract_cie_info): Fix aliasing in
	read_encoded_value call.
	(execute_cfa_program, uw_frame_state_for): Likewise.

From-SVN: r100927
2005-06-14 08:25:18 +00:00
Nathan Sidwell 79d0dfa314 unwind-dw2-fde-glibc.c (base_from_cb_data, [...]): Use gcc_assert and gcc_unreachable as appropriate.
* unwind-dw2-fde-glibc.c (base_from_cb_data,
	_Unwind_IteratePhdrCallback): Use gcc_assert and gcc_unreachable as
	appropriate.
	* unwind-dw2-fde.c (__deregister_frame_info_bases,
	base_from_object, fde_split, end_fde_sort): Likewise.
	* unwind-dw2.c (_Unwind_GetGR, _Unwind_SetGR, execute_stack_op,
	execute_cfa_program, _Unwind_SetSpColumn, uw_update_context_1,
	uw_init_context_1): Likewise.
	* unwind.inc (_Unwind_RaiseException_Phase2, _Unwind_Resume,
	_Unwind_Resume_or_Rethrow): Likewise.
	* unwind-pe.h (__gxx_abort): Do not define.
	(size_of_encoded_value, base_of_encoded_value,
	read_encoded_value_with_base): Use gcc_unreachable.
	* unwind.h (_Unwind_GetTextRelBase): Likewise.

From-SVN: r99835
2005-05-17 15:37:47 +00:00
Alan Modra 7a70673865 unwind-dw2.c (execute_stack_op): Add missing cases for DW_OP_shl, DW_OP_shr, DW_OP_shra, DW_OP_xor.
* unwind-dw2.c (execute_stack_op): Add missing cases for
	DW_OP_shl, DW_OP_shr, DW_OP_shra, DW_OP_xor.

From-SVN: r94314
2005-01-27 17:56:49 +10:30
H.J. Lu 780f9446a9 re PR target/18380 (_Unwind_FindTableEntry shouldn't be exported from libunwind.so.7)
2004-11-09  H.J. Lu  <hongjiu.lu@intel.com>

	PR target/18380
	* config/ia64/unwind-ia64.h (_Unwind_FindTableEntry): Mark it
	hidden.

	* unwind-dw2.c (_Unwind_FindTableEntry): Removed.

From-SVN: r90387
2004-11-09 22:33:28 -08:00
Kazu Hirata f30278e8b4 bitmap.c, [...]: Update copyright.
* bitmap.c, bitmap.h, builtin-attrs.def, cfglayout.h,
	collect2.h, conflict.c, coretypes.h, coverage.h, errors.h,
	gcc.h, gcov-dump.c, gen-protos.c, gencheck.c, gencodes.c,
	genconstants.c, gengenrtl.c, genmodes.c, genpeep.c,
	gensupport.h, graph.h, gthr-gnat.c, gthr-gnat.h, gthr-posix.c,
	gthr-posix.h, hard-reg-set.h, hwint.h, integrate.h, libgcc2.c,
	lists.c, machmode.def, mips-tdump.c, opts.h, params.c,
	predict.def, predict.h, protoize.c, reload.h, resource.h,
	rtl-error.c, sbitmap.c, sbitmap.h, sreal.c, tlink.c,
	tree-dump.h, tree-inline.h, unwind-dw2-fde.c, unwind-dw2.c,
	unwind-sjlj.c, value-prof.h: Update copyright.

From-SVN: r89097
2004-10-15 14:47:12 +00:00
Richard Henderson 282efe1c41 unwind-dw2.c (_Unwind_GetGR): Honor DWARF_ZERO_REG.
* unwind-dw2.c (_Unwind_GetGR): Honor DWARF_ZERO_REG.
        * doc/tm.texi (DWARF_ZERO_REG): New.
        * config/alpha/alpha.c (alpha_sa_mask, alpha_expand_prologue,
        alpha_expand_epilogue): Revert 2003-09-30 change to store zero.
        * config/alpha/alpha.h (DWARF_ZERO_REG): New.

From-SVN: r88331
2004-09-30 01:21:27 -07:00
Kaveh R. Ghazi 2c82eecc78 tsystem.h (alloca): Provide a default definition.
* tsystem.h (alloca): Provide a default definition.

	Revert:
	2001-08-31  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
	    * unwind-dw2.c: Call __builtin_alloca, not alloca.

From-SVN: r87775
2004-09-20 22:23:12 +00:00
Alan Modra 8662eb14c0 tm.texi (MD_UNWIND_SUPPORT): Document.
* doc/tm.texi (MD_UNWIND_SUPPORT): Document.
	(MD_FALLBACK_FRAME_STATE_FOR): Update.
	* unwind-dw2.c (MD_UNWIND_SUPPORT): #include if defined.
	(uw_frame_state_for): Adjust MD_FALLBACK_FRAME_STATE_FOR invocation.
	(MD_FROB_UPDATE_CONTEXT): Remove default.
	(uw_update_context_1): Instead #ifdef invocation.
	* config/ia64/unwind-ia64.c (MD_UNWIND_SUPPORT): #include if defined.
	(uw_frame_state_for): Adjust MD_FALLBACK_FRAME_STATE_FOR invocation.
	* config/alpha/gnu.h (MD_FALLBACK_FRAME_STATE_FOR): Don't undef.
	(MD_UNWIND_SUPPORT): Undefine this instead.
	* config/i386/gnu.h: Likewise.
	* config/alpha/linux-unwind.h: New file, macro converted to
	function, extracted from..
	* config/alpha/linux.h (MD_FALLBACK_FRAME_STATE_FOR): ..this.
	(MD_UNWIND_SUPPORT): Define.
	* config/alpha/vms-unwind.h, config/alpha/vms.h: Likewise.
	* config/i386/linux-unwind.h, config/i386/linux.h,
	config/i386/linux64.h: Likewise.
	* config/ia64/linux-unwind.h, config/ia64/linux.h: Likewise.
	MD_HANDLE_UNWABI too.
	* config/mips/linux-unwind.h, config/mips/linux.h: Likewise.
	* config/pa/linux-unwind.h, config/pa/pa32-linux.h: Likewise.
	* config/rs6000/darwin-unwind.h, config/rs6000/darwin.h: Likewise.
	* config/s390/linux-unwind.h, config/s390/linux.h: Likewise.
	* config/sparc/linux-unwind.h, config/sparc/linux.h,
	config/sparc/linux64.h: Likewise.
	* config/sh/linux-unwind.h, config/sh/linux.h: Likewise, but merge
	SH_FALLBACK_FRAME_FLOAT_STATE into sh_fallback_frame_state.
	* config/rs6000/linux-unwind.h, config/rs6000/linux.h,
	config/rs6000/linux64.h: Likewise.  Split out get_sigcontext
	function.  Use ARG_POINTER_REGNUM for 32-bit temp reg too.

From-SVN: r87167
2004-09-08 09:47:19 +09:30
H.J. Lu 443728bba4 re PR target/14925 (libunwind enabled gcc generates incompatible libgcc_s.so.1)
2004-09-03  H.J. Lu  <hongjiu.lu@intel.com>

	PR target/14925:
	Makefile.in (LIB2ADDEHSTATIC): New.
	(LIB2ADDEHSHARED): New.
	(LIBUNWIND): New.
	(LIBUNWINDDEP): New.
	(SHLIBUNWIND_LINK): New.
	(SHLIBUNWIND_INSTALL): New.
	(libgcc.mk): Pass LIB2ADDEHSTATIC, LIB2ADDEHSHARED, LIBUNWIND,
	LIBUNWINDDEP, SHLIBUNWIND_LINK and SHLIBUNWIND_INSTALL.
	(clean): Remove libunwind*
	(stage1-start): Remove and copy stage1/libunwind*.
	(stage2-start): Remove and copy stage2/libunwind*.
	(stage3-start): Remove and copy stage3/libunwind*.
	(stage4-start): Remove and copy stage4/libunwind*.
	(stageprofile-start): Remove and copy stageprofile/libunwind*.
	(stagefeedback-start): Remove and copy stagefeedback/libunwind*.

	* config.gcc (ia64*-*-linux*): Always add t-libunwind to
	tmake_file. Add t-libunwind-elf and ia64/t-glibc-libunwind to
	tmake_file if --with-system-libunwind isn't used.

	* config/ia64/t-glibc-libunwind: New file.
	* config/t-libunwind-elf: Likewise.
	* unwind-compat.c: Likewise.
	* unwind-compat.h: Likewise.
	* unwind-dw2-fde-compat.c: Likewise.

	* config/ia64/t-glibc (LIB2ADDEH): Updated.
	* config/ia64/t-hpux (T_CFLAGS): Add -DUSE_LIBUNWIND_EXCEPTIONS.

	* config/ia64/unwind-ia64.c: Include "unwind-compat.h". Define
	aliases if needed.
	* unwind-dw2-fde-glibc.c: Likewise.
	* unwind-dw2.c: Likewise.

	* config/t-libunwind (LIB2ADDEH): Updated.
	(LIB2ADDEHSTATIC): New.
	(T_CFLAGS): Add -DUSE_LIBUNWIND_EXCEPTIONS.
	(TARGET_LIBGCC2_CFLAGS): Set to -DUSE_GAS_SYMVER.

	* configure.ac: Change --enable-libunwind-exceptions to
	--with-system-libunwind. Don't define USE_LIBUNWIND_EXCEPTIONS.
	* configure: Regenerated.
	* config.in: Updated.

	* doc/install.texi (ia64-*-linux): Require libunwind 0.98 or
	above and mention --with-system-libunwind.
	(ia64-*-hpux*): Mention --enable-libunwind-exceptions is
	removed in gcc 3.4.3 and later.

	* gcc.c (init_spec): Add -lunwind to -lgcc_s if
	USE_LIBUNWIND_EXCEPTIONS is defined.

	* mklibgcc.in: Support libunwind.

From-SVN: r87066
2004-09-03 17:15:42 -07:00
Ulrich Weigand ca29916b48 unwind-dw2-fde.c (get_cie_encoding): Cast argument to strlen to eliminate warning.
* unwind-dw2-fde.c (get_cie_encoding): Cast argument to strlen
	to eliminate warning.
	(linear_search_fdes): Declare p as unsigned.
	(binary_search_mixed_encoding_fdes): Likewise.
	* unwind-dw2.c (get_cie_encoding): Cast argument to strlen
	to eliminate warning.
	* config/s390/linux.h (MD_FALLBACK_FRAME_STATE_FOR): Add missing
	type cast.

From-SVN: r86280
2004-08-19 21:41:32 +00:00
Paul Brook 9d8646d7b0 unwind-dw2.c (uw_install_context_1): Update target saved stack pointer.
* unwind-dw2.c (uw_install_context_1): Update target saved stack
	pointer.

Co-Authored-By: Richard Henderson <rth@redhat.com>

From-SVN: r85723
2004-08-09 20:31:41 +00:00
Geoffrey Keating f8a57be818 Index: gcc/ChangeLog
2004-06-28  Geoffrey Keating  <geoffk@apple.com>
	    Andreas Tobler  <a.tobler@schweiz.ch>

	PR 15813
	* dwarf2out.c (reg_save): Output DW_CFA_same_value when a
	register is saved in itself.
	(initial_return_save): If the return address is a register,
	it's already there, don't bother to mention it in the CFI.
	(struct queued_reg_save): Add field saved_reg.
	(struct reg_saved_in_data): New.
	(regs_saved_in_regs): New.
	(num_regs_saved_in_regs): New.
	(queue_reg_save): Add extra parameter to specify register saved
	in register.  Remove duplicate entries from queue.  Add comment
	for function.
	(flush_queued_reg_saves): Handle registers saved in registers.
	Update regs_saved_in_regs.  Add comment for function.
	(clobbers_queued_reg_save): Add comment for function.  Allow
	for regs_saved_in_regs.
	(reg_saved_in): New.
	(dwarf2out_frame_debug_expr): Handle saving registers in other
	registers.
	(dwarf2out_frame_debug): Reset regs_saved_in_regs.
	* unwind-dw2.c (execute_cfa_program): Correct handling of
	DW_CFA_same_value.  Add FIXME comment about incorrect implementation
	of DW_CFA_restore_extended.
	* config/rs6000/rs6000.c (rs6000_emit_prologue): Let
	dwarf2out_frame_debug_expr see instructions that save registers
	in other registers or save those other registers in memory.

	* unwind-dw2.c (DWARF_FRAME_REGISTERS): Move to unwind-dw2.h.
	(_Unwind_FrameState): Likewise.
	* unwind-dw2.h: New.
	* Makefile.in (LIB2ADDEHDEP): Add unwind-dw2.h.
	* config/rs6000/darwin-fallback.c: New file.
	* config/rs6000/darwin.h (MD_FALLBACK_FRAME_STATE_FOR): Define.
	* config/rs6000/t-darwin (LIB2FUNCS_EXTRA): Add darwin-fallback.o.

Index: gcc/testsuite/ChangeLog
2004-06-26  Geoffrey Keating  <geoffk@apple.com>
	    Andreas Tobler  <a.tobler@schweiz.ch>

	* gcc.dg/cleanup-10.c: Run on all Linux platforms and powerpc-darwin.
	Use SA_RESETHAND rather than SA_ONESHOT.  Trap SIGBUS as well
	as SIGSEGV.
	* gcc.dg/cleanup-11.c: Likewise.
	* gcc.dg/cleanup-8.c: Likewise.
	* gcc.dg/cleanup-9.c: Likewise.
	* gcc.dg/cleanup-5.c: Run on all platforms.

Index: libjava/ChangeLog
2004-06-26  Geoffrey Keating  <geoffk@apple.com>
	    Andreas Tobler  <a.tobler@schweiz.ch>

	* configure.host (powerpc-*-darwin*): New case, define
	can_unwind_signal.
	* configure.in (*-*-darwin*): New case, point to darwin-signal.h.
	* configure: Regenerate.
	* include/darwin-signal.h: New.

Co-Authored-By: Andreas Tobler <a.tobler@schweiz.ch>

From-SVN: r83953
2004-07-01 04:09:07 +00:00
Paul Brook 0ef54a47cf unwind-dw2-fde.c (get_cie_encoding): Handle dwarf3 CIE format.
* unwind-dw2-fde.c (get_cie_encoding): Handle dwarf3 CIE format.
	* unwind-dw2.c (extract_cie_info): Ditto.
	(_Unwind_FrameState): Change retaddr_column to word type.

From-SVN: r82072
2004-05-20 22:34:58 +00:00
Andreas Jaeger ab08fce55b unwind-dw2.c (_Unwind_FrameState): Remove commas at end of enumeration list.
* unwind-dw2.c (_Unwind_FrameState): Remove commas at end of
	enumeration list.

From-SVN: r73180
2003-11-01 19:31:56 +01:00
Andreas Jaeger f1518966c3 unwind-dw2.c (_Unwind_FindEnclosingFunction): Constify variable.
* unwind-dw2.c (_Unwind_FindEnclosingFunction): Constify variable.
	(uw_frame_state_for): Constify variables.
	(extract_cie_info): Constify first argument.

	* unwind-dw2-fde-darwin.c: Adjust prototype of
	_Unwind_Find_registered_FDE for recent changes.
	(examine_objects): Constify return value and local variable result.
	(_Unwind_Find_FDE): Constify return value and local variable ret.

From-SVN: r73172
2003-11-01 10:59:50 +01:00
Kaveh R. Ghazi 525996eb67 irix6-libc-compat.c (inet_makeaddr): Prototype.
* config/mips/irix6-libc-compat.c (inet_makeaddr): Prototype.
	* crtstuff.c (__do_global_ctors_1): Move prototype.
	* unwind-dw2.c (NO_SIZE_OF_ENCODED_VALUE): Define when
	appropriate.
	* unwind-sjlj.c (_Unwind_GetCFA, _Unwind_FindEnclosingFunction):
	Mark parameter with __attribute__((unused)).

From-SVN: r72999
2003-10-28 03:47:37 +00:00
Andreas Jaeger 36f9cf4ada unwind-dw2.c (_Unwind_GetGR): Avoid warning about unsigned comparison.
* unwind-dw2.c (_Unwind_GetGR): Avoid warning about unsigned
	comparison.
	(_Unwind_SetGR): Likewise.

From-SVN: r72960
2003-10-26 19:06:11 +01:00
Richard Henderson ed80cd6809 dwarf2out.c (expand_builtin_init_dwarf_reg_sizes): Honor DWARF_ALT_FRAME_RETURN_COLUMN.
* dwarf2out.c (expand_builtin_init_dwarf_reg_sizes): Honor
        DWARF_ALT_FRAME_RETURN_COLUMN.
        * unwind-dw2.c (dwarf_reg_size_table): Expand by one.
        (_Unwind_GetGR, _Unwind_SetGR): Validate lookup column.
        (uw_frame_state_for): Return end-of-stack for null return address.
        * doc/tm.texi (DWARF_ALT_FRAME_RETURN_COLUMN): Add.

        * config/alpha/alpha.c (alpha_sa_mask): Add r31 for eh_return.
        (alpha_expand_prologue): Store a zero for it.
        (alpha_expand_epilogue): Don't reload it.
        * config/alpha/alpha.h (DWARF_ALT_FRAME_RETURN_COLUMN): New.
        * config/alpha/linux.h (MD_FALLBACK_FRAME_STATE_FOR): Use column 64
        for the sigframe return address.

From-SVN: r71967
2003-09-30 23:01:47 -07:00
Daniel Jacobowitz 1ee93c1b04 unwind-c.c: Add libgcc-style exception.
* unwind-c.c: Add libgcc-style exception.
	* unwind-dw2.c: Likewise.
	* unwind-pe.h: Likewise.
	* unwind-sjlj.c: Likewise.
	* unwind.inc: Likewise.

From-SVN: r70576
2003-08-19 20:53:24 +00:00
Jakub Jelinek fc4767bbb6 unwind-dw2.c (MD_FROB_UPDATE_CONTEXT): Define.
* unwind-dw2.c (MD_FROB_UPDATE_CONTEXT): Define.
	(uw_update_context_1): Use it.
	* config/rs6000/rs6000.c (insn_after_throw): Remove.
	(rs6000_aix_emit_builtin_unwind_init): Save $r2 to its location
	in parent frame if _Unwind_* called directly instead of through
	.plt.
	(rs6000_emit_eh_toc_restore): Remove.
	(rs6000_emit_prologue): Update stack pointer before doing any saving
	if current_function_calls_eh_return.  Generate unwind info for $r2.
	(rs6000_emit_epilogue): Restore stack pointer after doing all
	restoring if current_function_calls_eh_return.  Restore $r2.
	* config/rs6000/rs6000-protos.h (rs6000_emit_eh_toc_restore): Remove.
	* config/rs6000/rs6000.md (eh_return): Remove call to
	rs6000_emit_eh_toc_restore.
	* config/rs6000/linux64.h (MD_FROB_UPDATE_CONTEXT): Define.
	* config/rs6000/aix.h (MD_FROB_UPDATE_CONTEXT): Define.

	* gcc.dg/cleanup-8.c: New test.
	* gcc.dg/cleanup-9.c: New test.

From-SVN: r69450
2003-07-16 13:52:55 +02:00
J"orn Rennecke 71628aa098 dwarf2out.c (expand_builtin_init_dwarf_reg_sizes): If DWARF_FRAME_RETURN_COLUMN doesn't have a register mode, use Pmode.
2003-07-15  J"orn Rennecke <joern.rennecke@superh.com>

	* dwarf2out.c (expand_builtin_init_dwarf_reg_sizes):
	If DWARF_FRAME_RETURN_COLUMN doesn't have a register mode, use Pmode.

2003-07-15  J"orn Rennecke <joern.rennecke@superh.com>
	    Richard Henderson  <rth@redhat.com>

	* unwind-dw2.c (_Unwind_GetGR): Use dwarf_reg_size_table
	to decide if to access a _Unwind_Ptr or a _Unwind_Word.
	(_Unwind_SetGR): Likewise.
	(_Unwind_GetPtr, _Unwind_SetSpColumn): New functions.
	(Unwind_SpTmp): New typedef.
	(uw_update_context_1): Use _Unwind_SetSpColumn and _Unwind_GetPtr.
	(uw_update_context): Use _Unwind_GetPtr.
	(init_dwarf_reg_size_table): Move above uw_init_context_1.
	(uw_init_context_1): Initialize dwarf_reg_size_table if necessary.
	Use _Unwind_SetSpColumn.
	(uw_install_context_1): Don't initialize dwarf_reg_size_table.
	Use _Unwind_GetPtr.

Co-Authored-By: Richard Henderson <rth@redhat.com>

From-SVN: r69424
2003-07-15 23:49:07 +01:00
Richard Sandiford 7f68692fb2 unwind-dw2.c (uw_init_context_1): Don't pass &outer_cfa directly to _Unwind_SetGRPtr().
* unwind-dw2.c (uw_init_context_1): Don't pass &outer_cfa directly
	to _Unwind_SetGRPtr().

From-SVN: r66753
2003-05-13 06:49:46 +00: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 9330e97701 unwind-dw2.c (_Unwind_GetGR): Cast pointer to _Unwind_Ptr, not _Unwind_Word.
* unwind-dw2.c (_Unwind_GetGR): Cast pointer to _Unwind_Ptr,
        not _Unwind_Word.

From-SVN: r66581
2003-05-07 15:01:37 -07:00
Richard Henderson 8b6891963b unwind-dw2.c (uw_update_context_1): Only set cfa as sp if previous frame didn't save sp.
* unwind-dw2.c (uw_update_context_1): Only set cfa as sp if
        previous frame didn't save sp.  Clear sp for next frame.
        (uw_install_context_1): Honor saved sp from frame.

From-SVN: r66526
2003-05-06 10:28:37 -07: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
Kean Johnston ac24fc99ac Part 2 of the SCO port update. This is everything I have approval for.
There are two outstanding patches I await approval to check in.

From-SVN: r65832
2003-04-19 21:23:20 +00:00
Richard Henderson 378683cf62 libgcc-std.ver (_Unwind_GetCFA): New.
* libgcc-std.ver (_Unwind_GetCFA): New.
        * unwind-dw2.c (_Unwind_GetCFA): New.
        * unwind-libunwind.c (_Unwind_GetCFA): New.
        * unwind-sjlj.c (_Unwind_GetCFA): New.
        * unwind.h: Declare it.

From-SVN: r65190
2003-04-02 18:06:55 -08:00
Aldy Hernandez 41f3a9307a tm.texi (Frame Registers): Document DWARF_REG_TO_UNWIND_COLUMN.
2003-03-11  Aldy Hernandez  <aldyh@redhat.com>

        * doc/tm.texi (Frame Registers): Document DWARF_REG_TO_UNWIND_COLUMN.

        * unwind-dw2.c (DWARF_REG_TO_UNWIND_COLUMN): Define.
        (_Unwind_GetGR): Use DWARF_REG_TO_UNWIND_COLUMN.
        (_Unwind_SetGR): Same.
        (_Unwind_GetGRPtr): New.
        (_Unwind_SetGRPtr): New.
        (uw_update_context_1): Use accesor functions instead of accessing
        context->reg[] directly.
        (uw_install_context_1): Same.
        (execute_cfa_program): Same.
        (__frame_state_for): Same.

        * config/rs6000/rs6000.c (spe_synthesize_frame_save): Use 1200 as
        the synthetic register offset.

        * config/rs6000/rs6000.h (DWARF_REG_TO_UNWIND_COLUMN): New.

From-SVN: r64186
2003-03-11 20:40:54 +00:00
Benjamin Kosnik cb25b0ce8d re PR libstdc++/9076 (Call Frame Instructions are not handled correctly during unwind operation..)
2003-01-07  Benjamin Kosnik  <bkoz@redhat.com>
	    Sunil Davasam  <sunil.k.davasam@intel.com>

	PR libstdc++/9076
	* unwind-dw2.c (execute_cfa_program): DW_CFA_undefined,
	DW_CFA_same_value, read next and ignore.

Co-Authored-By: Sunil Davasam <sunil.k.davasam@intel.com>

From-SVN: r61008
2003-01-07 20:20:53 +00:00
Zack Weinberg 4977bab6ed Merge basic-improvements-branch to trunk
From-SVN: r60174
2002-12-16 18:23:00 +00:00
Andrew Haley 5154b05d15 unwind-sjlj.c (_Unwind_FindEnclosingFunction): Rename from_Unwind_Find_Enclosing_Function.
2002-11-26  Andrew Haley  <aph@redhat.com>

        * unwind-sjlj.c (_Unwind_FindEnclosingFunction): Rename
        from_Unwind_Find_Enclosing_Function.
        * unwind-dw2.c (_Unwind_FindEnclosingFunction): Likewise.
        * config/ia64/unwind-ia64.c (_Unwind_FindEnclosingFunction): Likewise.
        * libgcc-std.ver (_Unwind_FindEnclosingFunction): Rename from
        _Unwind_Find_Enclosing_Function, export @@GCC_3.3.
        * unwind.h (_Unwind_FindEnclosingFunction): Add.

From-SVN: r59568
2002-11-27 10:33:56 +00:00
Andrew Haley 5dafd28231 libgcc-std.ver (_Unwind_Find_Enclosing_Function): Add.
2002-11-25  Andrew Haley  <aph@redhat.com>

        * libgcc-std.ver (_Unwind_Find_Enclosing_Function): Add.
        * config/ia64/unwind-ia64.c (_Unwind_Find_Enclosing_Function): New.
        * unwind-sjlj.c (_Unwind_Find_Enclosing_Function): Likewise.
        * unwind-dw2.c (_Unwind_Find_Enclosing_Function): Likewise.

From-SVN: r59460
2002-11-25 17:20:10 +00:00
Kazu Hirata 41077ce4b3 target.h: Fix formatting.
* target.h: Fix formatting.
	* timevar.h: Likewise.
	* tlink.c: Likewise.
	* toplev.c: Likewise.
	* toplev.h: Likewise.
	* tree.c: Likewise.
	* tree-dump.h: Likewise.
	* tree.h: Likewise.
	* tree-inline.h: Likewise.
	* unroll.c: Likewise.
	* unwind-dw2.c: Likewise.
	* unwind-dw2-fde.c: Likewise.
	* unwind-dw2-fde-glibc.c: Likewise.
	* unwind-dw2-fde.h: Likewise.
	* unwind.h: Likewise.
	* unwind-sjlj.c: Likewise.
	* varasm.c: Likewise.
	* varray.h: Likewise.
	* vmsdbg.h: Likewise.
	* vmsdbgout.c: Likewise.
	* xcoffout.h: Likewise.

From-SVN: r54123
2002-05-31 22:15:42 +00:00
Jason Merrill 81a60e6ca0 add comments
From-SVN: r50805
2002-03-15 05:18:21 -05:00
Kazu Hirata e9d1b155fc unwind-dw2.c: Fix formatting.
* unwind-dw2.c: Fix formatting.
	* unwind-dw2-fde.c: Likewise.
	* unwind-dw2-fde.h: Likewise.
	* unwind-pe.h: Likewise.
	* varasm.c: Likewise.
	* varray.h: Likewise.

From-SVN: r49045
2002-01-21 13:08:33 +00:00