diff options
-rw-r--r-- | gcc/ChangeLog | 75 | ||||
-rw-r--r-- | gcc/builtins.c | 2 | ||||
-rw-r--r-- | gcc/calls.c | 17 | ||||
-rw-r--r-- | gcc/config/avr/avr.h | 2 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 27 | ||||
-rw-r--r-- | gcc/config/i386/sysv3.h | 105 | ||||
-rw-r--r-- | gcc/config/ip2k/ip2k.h | 2 | ||||
-rw-r--r-- | gcc/doc/tm.texi | 8 | ||||
-rw-r--r-- | gcc/function.c | 8 | ||||
-rw-r--r-- | gcc/function.h | 4 | ||||
-rw-r--r-- | gcc/gcse.c | 40 | ||||
-rw-r--r-- | gcc/postreload-gcse.c | 10 | ||||
-rw-r--r-- | gcc/reload.c | 4 | ||||
-rw-r--r-- | gcc/reload1.c | 11 | ||||
-rw-r--r-- | gcc/system.h | 3 | ||||
-rw-r--r-- | gcc/tree-cfg.c | 7 | ||||
-rw-r--r-- | gcc/tree.h | 21 |
17 files changed, 81 insertions, 265 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 533c8aafa50..dbc9d4cc9e9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,34 @@ +2004-11-23 Zack Weinberg <zack@codesourcery.com> + + * function.h (struct function): Remove calls_longjmp. + (current_function_calls_longjmp): Delete. + * tree.h (ECF_LONGJMP): Delete. + (ECF_SIBCALL, ECF_PURE, ECF_SP_DEPRESSED, ECF_ALWAYS_RETURN) + (ECF_LIBCALL_BLOCK): Everybody slide down one. + (ECF_CONST, ECF_NORETURN, ECF_SIBCALL): Clarify comments. + * builtins.c (expand_builtin_longjmp): Don't set + current_function_calls_longjmp. + * calls.c (special_function_p): Mark longjmp and siglongjmp + with ECF_NORETURN, not ECF_LONGJMP. + (emit_call_1, expand_call, emit_library_call_value_1): + Don't check for ECF_LONGJMP. + * tree-cfg.c (make_exit_edges, is_ctrl_altering_stmt) + (need_fake_edge_p): Likewise. + + * config/avr/avr.h, config/ip2k/ip2k.h: Don't define NON_SAVING_SETJMP. + * system.h: Poison NON_SAVING_SETJMP. + * function.c (use_register_for_decl) + * gcse.c (compute_hash_table_work, compute_store_table) + * postreload-gcse.c (record_opr_changes) + * reload.c (find_equiv_reg) + * reload1.c (reload) + * config/i386/i386.c (ix86_can_use_return_insn_p): + Remove code conditional on NON_SAVING_SETJMP. + * doc/tm.texi: Delete documentation of NON_SAVING_SETJMP. + + * config/i386/sysv3.h: Delete file. + * config/i386/i386.c (ix86_svr3_asm_out_constructor): Delete. + 2004-11-23 Dorit Naishlos <dorit@il.ibm.com> * tree-vectorizer.c (vect_analyze_operations): Don't vectorize if @@ -64,7 +95,7 @@ removed. (DYNAMIC_CHAIN_ADDRESS): Use TARGET_PACKED_STACK. * config/s390/s390.md ("allocate_stack", "restore_stack_block") - ("save_stack_nonlocal", "restore_stack_nonlocal"): Modified to reflect + ("save_stack_nonlocal", "restore_stack_nonlocal"): Modified to reflect the change in target switch semantics. * config/s390/tpf.h (TARGET_DEFAULT_BACKCHAIN): Removed. (TARGET_DEFAULT): MASK_BACKCHAIN added. @@ -72,10 +103,10 @@ 2004-11-23 Uros Bizjak <uros@kss-loka.si> - PR rtl-optimization/18614 - * simplify-rtx.c (simplify_binary_operation): Do not - simplify inner elements of constant arguments of - VEC_CONCAT insn. + PR rtl-optimization/18614 + * simplify-rtx.c (simplify_binary_operation): Do not + simplify inner elements of constant arguments of + VEC_CONCAT insn. 2004-11-23 Eric Botcazou <ebotcazou@libertysurf.fr> @@ -110,7 +141,7 @@ * tree-vectorizer.c (vect_create_data_ref_ptr): Use lang_hooks.types.type_for_size instead of integer_type_node for the type of ptr_update. - + 2004-11-23 Ralf Corsepius <ralf.corsepius@rtems.org> * config.gcc (h8300-*-rtems*): Use h8300/t-rtems. @@ -189,7 +220,7 @@ logbdf2, logbxf2, ilogbsi2, *f2xm1xf2, *fscalexf4, expsf2, expdf2, expxf2, exp10sf2, exp10df2, exp10xf2, exp2sf2, exp2df2, exp2xf2, expm1df2, expm1sf2, expm1xf2, frndintxf2, rintdf2, - rintsf2, rintxf2, frndintxf2_floor, floordf2, floorsf2, + rintsf2, rintxf2, frndintxf2_floor, floordf2, floorsf2, floorxf2, frndintxf2_ceil, ceildf2, ceilsf2, ceilxf2, frndintxf2_trunc, btruncdf2, btruncsf2, btruncxf2, frndintxf2_mask_pm, nearbyintdf2, nearbyintsf2, nearbyintxf2): @@ -222,7 +253,7 @@ 2004-11-22 Devang Patel <dpatel@apple.com> * tree-if-conv.c (clean_predicate_lists): Clean all basic blocks. - + 2004-11-22 Devang Patel <dpatel@apple.com> * tree-if-conv.c (if_convertable_phi_p): Rename to ... @@ -235,7 +266,7 @@ (if_convertible_bb_p): ... new name. (if_convertable_loop_p): Rename to ... (if_convertible_loop_p): ... new name. - + 2004-11-22 Eric Botcazou <ebotcazou@libertysurf.fr> PR target/18444 @@ -319,7 +350,7 @@ 2004-11-22 Daniel Berlin <dberlin@dberlin.org> - * tree-ssa.c (verify_ssa): SSA_OP_ALL_USES should be + * tree-ssa.c (verify_ssa): SSA_OP_ALL_USES should be SSA_OP_ALL_USES | SSA_OP_ALL_KILLS for verification purposes. 2004-11-22 David Edelsohn <edelsohn@gnu.org> @@ -426,7 +457,7 @@ (vect_update_niters_after_peeling): Use type of niters instead of integer_type. (vect_transform_loop): Unify handling of known and unknown loop bound - cases. Call make_loop_iterate_ntimes instead of + cases. Call make_loop_iterate_ntimes instead of vect_transform_loop_bound. 2004-11-22 Andrew Pinski <pinskia@physics.uc.edu> @@ -443,7 +474,7 @@ 2004-11-22 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com> * config.gcc: Use t-slibgcc-elf to build libgcc_s.so on - m32r*linux. + m32r*linux. * config/m32r/t-linux (SHLIB_MAPFILES): Override to use m32r/libgcc-glibc.ver. * config/m32r/libgcc-glibc.ver: Add New file. @@ -679,8 +710,8 @@ 2004-11-19 Aldy Hernandez <aldyh@redhat.com> - * simplify-rtx.c (simplify_ternary_operation): Use - gen_int_mode. + * simplify-rtx.c (simplify_ternary_operation): Use + gen_int_mode. 2004-11-19 Kazu Hirata <kazu@cs.umass.edu> @@ -733,12 +764,12 @@ (slpeel_tree_peel_loop_to_edge): Call slpeel_make_loop_iterate_ntimes without last two arguments. Update single_exit of loops. (vect_update_niters_after_peeling): Removed. Its functionality was - moved to vect_do_peeling_for_alignment. + moved to vect_do_peeling_for_alignment. (vect_do_peeling_for_loop_bound): New name for function previously called vect_transform_for_unknown_loop_bound. (vect_transform_loop_bound): Call slpeel_make_loop_iterate_ntimes instead of code that duplicates the same functionality. - (vect_do_peeling_for_alignment): Functionality of + (vect_do_peeling_for_alignment): Functionality of vect_update_niters_after_peeling moved here. (vect_transform_loop): Unify call to vect_do_peeling_for_loop_bound - previously named vect_transform_for_unknown_loop_bound - for both known @@ -912,7 +943,7 @@ altivec_lvx_4sf): Rename and replace with ... (altivec_lvx_<mode>): ... mode macro version. (altivec_stvx_4si, altivec_stvx_8hi, altivec_stvx_16qi, - altivec_stvx_4sf): Rename and replace with ... + altivec_stvx_4sf): Rename and replace with ... (altivec_stvx_<mode>): ... mode macro version. (movv4si, movv8hi, movv16qi, movv4sf}): Replace with ... (mov<mode>): ... mode macro version. @@ -977,10 +1008,10 @@ 2004-11-18 Uros Bizjak <uros@kss-loka.si> - * configure/i386/i386.md (*fix_trunch_1): Add "&& 1" to - insn split constraint. - (define_peephole2): Remove unneeded "&& 1" from peephole2 - constraints. + * configure/i386/i386.md (*fix_trunch_1): Add "&& 1" to + insn split constraint. + (define_peephole2): Remove unneeded "&& 1" from peephole2 + constraints. 2004-11-18 Ben Elliston <bje@au.ibm.com> @@ -996,7 +1027,7 @@ * config/i386/i386.c (i386_solaris_elf_named_section): Mark with ATTRIBUTE_UNUSED. - + 2004-11-17 Zack Weinberg <zack@codesourcery.com> * defaults.h, config/darwin.h: Don't define TARGET_SUPPORTS_HIDDEN. diff --git a/gcc/builtins.c b/gcc/builtins.c index 5b476ca8fec..6c17e23acf9 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -708,8 +708,6 @@ expand_builtin_longjmp (rtx buf_addr, rtx value) longer copying around a value that we don't care about. */ gcc_assert (value == const1_rtx); - current_function_calls_longjmp = 1; - last = get_last_insn (); #ifdef HAVE_builtin_longjmp if (HAVE_builtin_longjmp) diff --git a/gcc/calls.c b/gcc/calls.c index 84d44350c4b..44806d4c8df 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -435,7 +435,7 @@ emit_call_1 (rtx funexp, tree fntree, tree fndecl ATTRIBUTE_UNUSED, if (rounded_stack_size != 0) { - if (ecf_flags & (ECF_SP_DEPRESSED | ECF_NORETURN | ECF_LONGJMP)) + if (ecf_flags & (ECF_SP_DEPRESSED | ECF_NORETURN)) /* Just pretend we did the pop. */ stack_pointer_delta -= rounded_stack_size; else if (flag_defer_pop && inhibit_defer_pop == 0 @@ -525,7 +525,7 @@ special_function_p (tree fndecl, int flags) if (tname[1] == 'i' && ! strcmp (tname, "siglongjmp")) - flags |= ECF_LONGJMP; + flags |= ECF_NORETURN; } else if ((tname[0] == 'q' && tname[1] == 's' && ! strcmp (tname, "qsetjmp")) @@ -535,7 +535,7 @@ special_function_p (tree fndecl, int flags) else if (tname[0] == 'l' && tname[1] == 'o' && ! strcmp (tname, "longjmp")) - flags |= ECF_LONGJMP; + flags |= ECF_NORETURN; } return flags; @@ -2174,7 +2174,7 @@ expand_call (tree exp, rtx target, int ignore) || !targetm.function_ok_for_sibcall (fndecl, exp) /* Functions that do not return exactly once may not be sibcall optimized. */ - || (flags & (ECF_RETURNS_TWICE | ECF_LONGJMP | ECF_NORETURN)) + || (flags & (ECF_RETURNS_TWICE | ECF_NORETURN)) || TYPE_VOLATILE (TREE_TYPE (TREE_TYPE (addr))) /* If the called function is nested in the current one, it might access some of the caller's arguments, but could clobber them beforehand if @@ -2753,7 +2753,7 @@ expand_call (tree exp, rtx target, int ignore) if nonvolatile values are live. For functions that cannot return, inform flow that control does not fall through. */ - if ((flags & (ECF_NORETURN | ECF_LONGJMP)) || pass == 0) + if ((flags & ECF_NORETURN) || pass == 0) { /* The barrier must be emitted immediately after the CALL_INSN. Some ports emit more @@ -2779,9 +2779,6 @@ expand_call (tree exp, rtx target, int ignore) } } - if (flags & ECF_LONGJMP) - current_function_calls_longjmp = 1; - /* If value type not void, return an rtx for the value. */ if (TYPE_MODE (TREE_TYPE (exp)) == VOIDmode @@ -2979,7 +2976,7 @@ expand_call (tree exp, rtx target, int ignore) normal_call_insns = insns; /* Verify that we've deallocated all the stack we used. */ - gcc_assert ((flags & (ECF_NORETURN | ECF_LONGJMP)) + gcc_assert ((flags & ECF_NORETURN) || (old_stack_allocated == stack_pointer_delta - pending_stack_adjust)); } @@ -3694,7 +3691,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, if nonvolatile values are live. For functions that cannot return, inform flow that control does not fall through. */ - if (flags & (ECF_NORETURN | ECF_LONGJMP)) + if (flags & ECF_NORETURN) { /* The barrier note must be emitted immediately after the CALL_INSN. Some ports emit more than diff --git a/gcc/config/avr/avr.h b/gcc/config/avr/avr.h index 669ca36d26a..f1c6da00b05 100644 --- a/gcc/config/avr/avr.h +++ b/gcc/config/avr/avr.h @@ -196,8 +196,6 @@ extern int avr_asm_only_p; 1,1,/* STACK */ \ 1,1 /* arg pointer */ } -#define NON_SAVING_SETJMP 0 - #define REG_ALLOC_ORDER { \ 24,25, \ 18,19, \ diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index adb4e5ba32e..3fca2f71c81 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -924,9 +924,6 @@ static bool ix86_must_pass_in_stack (enum machine_mode mode, tree type); static bool ix86_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode, tree, bool); -#if defined (DO_GLOBAL_CTORS_BODY) && defined (HAS_INIT_SECTION) -static void ix86_svr3_asm_out_constructor (rtx, int); -#endif /* This function is only used on Solaris. */ static void i386_solaris_elf_named_section (const char *, unsigned int, tree) ATTRIBUTE_UNUSED; @@ -3709,24 +3706,13 @@ symbolic_reference_mentioned_p (rtx op) body of a function. Do this only if the epilogue is simple, needing a couple of insns. Prior to reloading, we can't tell how many registers must be saved, so return 0 then. Return 0 if there is no frame - marker to de-allocate. - - If NON_SAVING_SETJMP is defined and true, then it is not possible - for the epilogue to be simple, so return 0. This is a special case - since NON_SAVING_SETJMP will not cause regs_ever_live to change - until final, but jump_optimize may need to know sooner if a - `return' is OK. */ + marker to de-allocate. */ int ix86_can_use_return_insn_p (void) { struct ix86_frame frame; -#ifdef NON_SAVING_SETJMP - if (NON_SAVING_SETJMP && current_function_calls_setjmp) - return 0; -#endif - if (! reload_completed || frame_pointer_needed) return 0; @@ -14374,17 +14360,6 @@ ix86_rtx_costs (rtx x, int code, int outer_code, int *total) } } -#if defined (DO_GLOBAL_CTORS_BODY) && defined (HAS_INIT_SECTION) -static void -ix86_svr3_asm_out_constructor (rtx symbol, int priority ATTRIBUTE_UNUSED) -{ - init_section (); - fputs ("\tpushl $", asm_out_file); - assemble_name (asm_out_file, XSTR (symbol, 0)); - fputc ('\n', asm_out_file); -} -#endif - #if TARGET_MACHO static int current_machopic_label_num; diff --git a/gcc/config/i386/sysv3.h b/gcc/config/i386/sysv3.h deleted file mode 100644 index b2643b14eb3..00000000000 --- a/gcc/config/i386/sysv3.h +++ /dev/null @@ -1,105 +0,0 @@ -/* Definitions for Intel 386 running system V. - Copyright (C) 1988, 1996, 2000, 2002 Free Software Foundation, Inc. - -This file is part of GCC. - -GCC 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. - -GCC 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 GCC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -#define TARGET_VERSION fprintf (stderr, " (80386, ATT syntax)"); - -/* Use crt1.o as a startup file and crtn.o as a closing file. */ - -#define STARTFILE_SPEC \ - "%{pg:gcrt1.o%s}%{!pg:%{posix:%{p:mcrtp1.o%s}%{!p:crtp1.o%s}}%{!posix:%{p:mcrt1.o%s}%{!p:crt1.o%s}}} crtbegin.o%s\ - %{p:-L/usr/lib/libp}%{pg:-L/usr/lib/libp}" - -/* ??? There is a suggestion that -lg is needed here. - Does anyone know whether this is right? */ -#define LIB_SPEC "%{posix:-lcposix} %{shlib:-lc_s} -lc crtend.o%s crtn.o%s" - -/* Specify predefined symbols in preprocessor. */ - -#define TARGET_OS_CPP_BUILTINS() \ - do \ - { \ - builtin_define_std ("unix"); \ - builtin_assert ("system=svr3"); \ - } \ - while (0) - -#define CPP_SPEC "%{posix:-D_POSIX_SOURCE}" - -/* Writing `int' for a bit-field forces int alignment for the structure. */ - -#define PCC_BITFIELD_TYPE_MATTERS 1 - -/* We want to be able to get DBX debugging information via -gstabs. */ - -#define DBX_DEBUGGING_INFO 1 - -#undef PREFERRED_DEBUGGING_TYPE -#define PREFERRED_DEBUGGING_TYPE SDB_DEBUG - -/* longjmp may fail to restore the registers if called from the same - function that called setjmp. To compensate, the compiler avoids - putting variables in registers in functions that use both setjmp - and longjmp. */ - -#define NON_SAVING_SETJMP \ - (current_function_calls_setjmp && current_function_calls_longjmp) - -/* longjmp may fail to restore the stack pointer if the saved frame - pointer is the same as the caller's frame pointer. Requiring a frame - pointer in any function that calls setjmp or longjmp avoids this - problem, unless setjmp and longjmp are called from the same function. - Since a frame pointer will be required in such a function, it is OK - that the stack pointer is not restored. */ - -#undef SUBTARGET_FRAME_POINTER_REQUIRED -#define SUBTARGET_FRAME_POINTER_REQUIRED \ - (current_function_calls_setjmp || current_function_calls_longjmp) - -/* Modify ASM_OUTPUT_LOCAL slightly to test -msvr3-shlib. */ -#undef ASM_OUTPUT_LOCAL -#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \ - do { \ - int align = exact_log2 (ROUNDED); \ - if (align > 2) align = 2; \ - if (TARGET_SVR3_SHLIB) \ - data_section (); \ - else \ - bss_section (); \ - ASM_OUTPUT_ALIGN ((FILE), align == -1 ? 2 : align); \ - ASM_OUTPUT_LABEL ((FILE), (NAME)); \ - fprintf ((FILE), "\t.set .,.+%u\n", (int)(ROUNDED));\ - } while (0) - -/* Define a few machine-specific details of the implementation of - constructors. - - The __CTORS_LIST__ goes in the .init section. Define CTOR_LIST_BEGIN - and CTOR_LIST_END to contribute to the .init section an instruction to - push a word containing 0 (or some equivalent of that). */ - -#undef INIT_SECTION_ASM_OP -#define INIT_SECTION_ASM_OP "\t.section .init,\"x\"" - -#define CTOR_LIST_BEGIN \ - asm (INIT_SECTION_ASM_OP); \ - asm ("pushl $0") -#define CTOR_LIST_END CTOR_LIST_BEGIN - -#define TARGET_ASM_CONSTRUCTOR ix86_svr3_asm_out_constructor diff --git a/gcc/config/ip2k/ip2k.h b/gcc/config/ip2k/ip2k.h index aecc8cdf56b..06381987ac6 100644 --- a/gcc/config/ip2k/ip2k.h +++ b/gcc/config/ip2k/ip2k.h @@ -184,8 +184,6 @@ extern int target_flags; 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,/*r224..r255*/\ 1,1,1,1} -#define NON_SAVING_SETJMP 0 - #define REG_ALLOC_ORDER { \ 0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f, \ 0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97, \ diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index afc029b1955..72d49f3a9b6 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -1983,14 +1983,6 @@ controlled by target switches, then GCC will automatically avoid using these registers when the target switches are opposed to them.) @end defmac -@defmac NON_SAVING_SETJMP -If this macro is defined and has a nonzero value, it means that -@code{setjmp} and related functions fail to save the registers, or that -@code{longjmp} fails to restore them. To compensate, the compiler -avoids putting variables in registers in functions that use -@code{setjmp}. -@end defmac - @defmac INCOMING_REGNO (@var{out}) Define this macro if the target machine has register windows. This C expression returns the register number as seen by the called function diff --git a/gcc/function.c b/gcc/function.c index ce1fd9eb3ac..da78d3fe022 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -1926,14 +1926,6 @@ use_register_for_decl (tree decl) if (DECL_ARTIFICIAL (decl)) return true; -#ifdef NON_SAVING_SETJMP - /* Protect variables not declared "register" from setjmp. */ - if (NON_SAVING_SETJMP - && current_function_calls_setjmp - && !DECL_REGISTER (decl)) - return false; -#endif - return (optimize || DECL_REGISTER (decl)); } diff --git a/gcc/function.h b/gcc/function.h index addf21365d4..1c32c9fbc5b 100644 --- a/gcc/function.h +++ b/gcc/function.h @@ -357,9 +357,6 @@ struct function GTY(()) /* Nonzero if function being compiled can call setjmp. */ unsigned int calls_setjmp : 1; - /* Nonzero if function being compiled can call longjmp. */ - unsigned int calls_longjmp : 1; - /* Nonzero if function being compiled can call alloca, either as a subroutine or builtin. */ unsigned int calls_alloca : 1; @@ -449,7 +446,6 @@ extern int trampolines_created; #define current_function_returns_pointer (cfun->returns_pointer) #define current_function_calls_setjmp (cfun->calls_setjmp) #define current_function_calls_alloca (cfun->calls_alloca) -#define current_function_calls_longjmp (cfun->calls_longjmp) #define current_function_calls_eh_return (cfun->calls_eh_return) #define current_function_has_computed_jump (cfun->has_computed_jump) #define current_function_contains_functions (cfun->contains_functions) diff --git a/gcc/gcse.c b/gcc/gcse.c index 25c53c77ae0..bddbbb4b574 100644 --- a/gcc/gcse.c +++ b/gcc/gcse.c @@ -2126,16 +2126,8 @@ compute_hash_table_work (struct hash_table *table) if (CALL_P (insn)) { - bool clobbers_all = false; -#ifdef NON_SAVING_SETJMP - if (NON_SAVING_SETJMP - && find_reg_note (insn, REG_SETJMP, NULL_RTX)) - clobbers_all = true; -#endif - for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) - if (clobbers_all - || TEST_HARD_REG_BIT (regs_invalidated_by_call, regno)) + if (TEST_HARD_REG_BIT (regs_invalidated_by_call, regno)) record_last_reg_set_info (insn, regno); mark_call (insn); @@ -5784,16 +5776,8 @@ compute_store_table (void) if (CALL_P (insn)) { - bool clobbers_all = false; -#ifdef NON_SAVING_SETJMP - if (NON_SAVING_SETJMP - && find_reg_note (insn, REG_SETJMP, NULL_RTX)) - clobbers_all = true; -#endif - for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) - if (clobbers_all - || TEST_HARD_REG_BIT (regs_invalidated_by_call, regno)) + if (TEST_HARD_REG_BIT (regs_invalidated_by_call, regno)) { last_set_in[regno] = INSN_UID (insn); SET_BIT (reg_set_in_block[bb->index], regno); @@ -5817,16 +5801,8 @@ compute_store_table (void) if (CALL_P (insn)) { - bool clobbers_all = false; -#ifdef NON_SAVING_SETJMP - if (NON_SAVING_SETJMP - && find_reg_note (insn, REG_SETJMP, NULL_RTX)) - clobbers_all = true; -#endif - for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) - if (clobbers_all - || TEST_HARD_REG_BIT (regs_invalidated_by_call, regno)) + if (TEST_HARD_REG_BIT (regs_invalidated_by_call, regno)) already_set[regno] = 1; } @@ -5841,16 +5817,8 @@ compute_store_table (void) note_stores (pat, reg_clear_last_set, last_set_in); if (CALL_P (insn)) { - bool clobbers_all = false; -#ifdef NON_SAVING_SETJMP - if (NON_SAVING_SETJMP - && find_reg_note (insn, REG_SETJMP, NULL_RTX)) - clobbers_all = true; -#endif - for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) - if ((clobbers_all - || TEST_HARD_REG_BIT (regs_invalidated_by_call, regno)) + if (TEST_HARD_REG_BIT (regs_invalidated_by_call, regno) && last_set_in[regno] == INSN_UID (insn)) last_set_in[regno] = 0; } diff --git a/gcc/postreload-gcse.c b/gcc/postreload-gcse.c index 144cc5f67b6..24c233caea3 100644 --- a/gcc/postreload-gcse.c +++ b/gcc/postreload-gcse.c @@ -712,17 +712,9 @@ record_opr_changes (rtx insn) if (CALL_P (insn)) { unsigned int regno; - bool clobbers_all = false; - -#ifdef NON_SAVING_SETJMP - if (NON_SAVING_SETJMP - && find_reg_note (insn, REG_SETJMP, NULL_RTX)) - clobbers_all = true; -#endif for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) - if (clobbers_all - || TEST_HARD_REG_BIT (regs_invalidated_by_call, regno)) + if (TEST_HARD_REG_BIT (regs_invalidated_by_call, regno)) record_last_reg_set_info (insn, regno); if (! CONST_OR_PURE_CALL_P (insn)) diff --git a/gcc/reload.c b/gcc/reload.c index c56a499a4e7..9e219a0978c 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -6693,10 +6693,6 @@ find_equiv_reg (rtx goal, rtx insn, enum reg_class class, int other, for (i = 0; i < valuenregs; ++i) if (call_used_regs[valueno + i]) return 0; -#ifdef NON_SAVING_SETJMP - if (NON_SAVING_SETJMP && find_reg_note (p, REG_SETJMP, NULL)) - return 0; -#endif } if (INSN_P (p)) diff --git a/gcc/reload1.c b/gcc/reload1.c index c38ec99f32e..9ffa798e1cf 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -682,17 +682,6 @@ reload (rtx first, int global) if (! call_used_regs[i] && ! fixed_regs[i] && ! LOCAL_REGNO (i)) regs_ever_live[i] = 1; -#ifdef NON_SAVING_SETJMP - /* A function that calls setjmp should save and restore all the - call-saved registers on a system where longjmp clobbers them. */ - if (NON_SAVING_SETJMP && current_function_calls_setjmp) - { - for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) - if (! call_used_regs[i]) - regs_ever_live[i] = 1; - } -#endif - /* Find all the pseudo registers that didn't get hard regs but do have known equivalent constants or memory slots. These include parameters (known equivalent to parameter slots) diff --git a/gcc/system.h b/gcc/system.h index 05b5150da76..dfaec16f7f3 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -657,7 +657,8 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN; ASM_OUTPUT_FILENAME ASM_OUTPUT_SOURCE_LINE FILE_NAME_JOINER \ GDB_INV_REF_REGPARM_STABS_LETTER DBX_MEMPARM_STABS_LETTER \ PUT_SDB_SRC_FILE STABS_GCC_MARKER DBX_OUTPUT_FUNCTION_END \ - DBX_OUTPUT_GCC_MARKER DBX_FINISH_SYMBOL SDB_GENERATE_FAKE + DBX_OUTPUT_GCC_MARKER DBX_FINISH_SYMBOL SDB_GENERATE_FAKE \ + NON_SAVING_SETJMP /* Hooks that are no longer used. */ #pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE \ diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index b59c8f7ccbb..bcd025f717d 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -552,7 +552,7 @@ make_exit_edges (basic_block bb) such a bloody pain to avoid creating edges for this case since all we do is remove these edges when we're done building the CFG. */ - if (call_expr_flags (last) & (ECF_NORETURN | ECF_LONGJMP)) + if (call_expr_flags (last) & ECF_NORETURN) { make_edge (bb, EXIT_BLOCK_PTR, EDGE_FAKE); return; @@ -2546,7 +2546,7 @@ is_ctrl_altering_stmt (tree t) return true; /* A CALL_EXPR also alters control flow if it does not return. */ - if (call_expr_flags (call) & (ECF_NORETURN | ECF_LONGJMP)) + if (call_expr_flags (call) & ECF_NORETURN) return true; } @@ -5148,8 +5148,7 @@ need_fake_edge_p (tree t) leads to different results from -fbranch-probabilities. */ call = get_call_expr_in (t); if (call - && !(call_expr_flags (call) & - (ECF_NORETURN | ECF_LONGJMP | ECF_ALWAYS_RETURN))) + && !(call_expr_flags (call) & (ECF_NORETURN | ECF_ALWAYS_RETURN))) return true; if (TREE_CODE (t) == ASM_EXPR diff --git a/gcc/tree.h b/gcc/tree.h index dc4a9d44ec8..aa533a4f6f0 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -3648,9 +3648,11 @@ extern rtx emit_line_note (location_t); /* In calls.c */ -/* Nonzero if this is a call to a `const' function. */ +/* Nonzero if this is a call to a function whose return value depends + solely on its arguments, has no side effects, and does not read + global memory. */ #define ECF_CONST 1 -/* Nonzero if this is a call to a `volatile' function. */ +/* Nonzero if this call will never return. */ #define ECF_NORETURN 2 /* Nonzero if this is a call to malloc or a related function. */ #define ECF_MALLOC 4 @@ -3660,21 +3662,18 @@ extern rtx emit_line_note (location_t); #define ECF_NOTHROW 16 /* Nonzero if this is a call to setjmp or a related function. */ #define ECF_RETURNS_TWICE 32 -/* Nonzero if this is a call to `longjmp'. */ -#define ECF_LONGJMP 64 -/* Nonzero if this is a syscall that makes a new process in the image of - the current one. */ -#define ECF_SIBCALL 128 +/* Nonzero if this call replaces the current stack frame. */ +#define ECF_SIBCALL 64 /* Nonzero if this is a call to "pure" function (like const function, but may read memory. */ -#define ECF_PURE 256 +#define ECF_PURE 128 /* Nonzero if this is a call to a function that returns with the stack pointer depressed. */ -#define ECF_SP_DEPRESSED 512 +#define ECF_SP_DEPRESSED 256 /* Nonzero if this call is known to always return. */ -#define ECF_ALWAYS_RETURN 1024 +#define ECF_ALWAYS_RETURN 512 /* Create libcall block around the call. */ -#define ECF_LIBCALL_BLOCK 2048 +#define ECF_LIBCALL_BLOCK 1024 extern int flags_from_decl_or_type (tree); extern int call_expr_flags (tree); |