From 843b04fb90dac46f9abdcbaeb18bf2911c818124 Mon Sep 17 00:00:00 2001 From: "David E. O'Brien" Date: Mon, 19 Mar 2001 19:46:16 +0000 Subject: [PATCH] Virgin import of the GCC 2.95.3 compilers --- contrib/gcc/ChangeLog | 29 +++++ contrib/gcc/NEWS | 17 ++- contrib/gcc/config/i386/freebsd.h | 2 +- contrib/gcc/config/i386/freebsd.h.fixed | 2 +- contrib/gcc/cp/ChangeLog | 4 + contrib/gcc/except.c | 61 ++++------- contrib/gcc/expr.c | 140 +++++++++--------------- contrib/gcc/expr.h | 3 +- contrib/gcc/f/ChangeLog | 4 + contrib/gcc/f/version.c | 2 +- contrib/gcc/final.c | 2 +- contrib/gcc/varasm.c | 12 -- contrib/gcc/version.c | 2 +- 13 files changed, 124 insertions(+), 156 deletions(-) diff --git a/contrib/gcc/ChangeLog b/contrib/gcc/ChangeLog index 2ba79675b203..be37364ac606 100644 --- a/contrib/gcc/ChangeLog +++ b/contrib/gcc/ChangeLog @@ -1,3 +1,32 @@ +Fri Mar 16 12:46:19 GMT 2001 Bernd Schmidt (bernds@redhat.com) + + * gcc-2.95.3 Released. + +2001-03-12 Kazu Hirata + + * config/h8300/h8300.md (movsi_h8300hs): Split the 2nd alternative + into two parts. + +2001-03-12 Bernd Schmidt + + * version.c: Bump. + + * final.c (alter_subreg): Use plus_constant_for_output to match + what offsettable_address_p does. + +2001-02-19 Bernd Schmidt + + * version.c: Bump. + + Back out sjlj eh fixes. + * varasm.c (force_const_mem): Revert previous change. + * except.c (receive_exception_label, start_dynamic_handler): + Likewise. + * expr.c (expand_builtin_setjmp, expand_builtin_setjmp_setup, + expand_builtin_setjmp_receiver, expand_builtin): Likewise. + * expr.h (expand_builtin_setjmp, expand_builtin_setjmp_receiver): + Likewise. + 2001-01-25 Bernd Schmidt * version.c: Bump. diff --git a/contrib/gcc/NEWS b/contrib/gcc/NEWS index d66c6e86ecd3..5023a93b5214 100644 --- a/contrib/gcc/NEWS +++ b/contrib/gcc/NEWS @@ -9,10 +9,10 @@ http://gcc.gnu.org/gcc-2.95/gcc-2.95.3.html GCC 2.95.3 - January 11, 2001 + March 16, 2001 The GNU project and the GCC developers are pleased to announce the - prerelease of GCC version 2.95.3. GCC used to stand for the GNU C + release of GCC version 2.95.3. GCC used to stand for the GNU C Compiler, but since the compiler supports several other languages aside from C, it now stands for the GNU Compiler Collection. @@ -24,7 +24,6 @@ http://gcc.gnu.org/gcc-2.95/gcc-2.95.3.html the register reloading code. + Fix numerous problems that caused incorrect optimization in the loop optimizer. - + Fix setjmp/longjmp based exception handling. + Fix aborts in the functions build_insn_chain and scan_loops under some circumstances. + Fix an alias analysis bug. @@ -77,7 +76,7 @@ http://gcc.gnu.org/gcc-2.95/gcc-2.95.3.html [15]The GCC team - Last modified 2001-01-11 + Last modified 2001-03-16 References @@ -225,7 +224,7 @@ http://gcc.gnu.org/gcc-2.95/gcc-2.95.2.html [14]The GCC team - Last modified 2000-11-10 + Last modified 2001-02-12 References @@ -347,7 +346,7 @@ http://gcc.gnu.org/gcc-2.95/gcc-2.95.1.html [14]The GCC team - Last modified 2000-11-10 + Last modified 2001-02-12 References @@ -414,7 +413,7 @@ http://gcc.gnu.org/gcc-2.95/gcc-2.95.html [14]The GCC team - Last modified 2000-11-10 + Last modified 2001-02-12 References @@ -503,7 +502,7 @@ http://gcc.gnu.org/gcc-2.95/features.html [18]The GCC team - Last modified 2000-12-04 + Last modified 2001-02-12 References @@ -573,7 +572,7 @@ http://gcc.gnu.org/gcc-2.95/caveats.html [4]The GCC team - Last modified 2000-11-10 + Last modified 2001-02-12 References diff --git a/contrib/gcc/config/i386/freebsd.h b/contrib/gcc/config/i386/freebsd.h index 8c907bf9d1e4..e97d4ca07bb2 100644 --- a/contrib/gcc/config/i386/freebsd.h +++ b/contrib/gcc/config/i386/freebsd.h @@ -37,7 +37,7 @@ Boston, MA 02111-1307, USA. */ /* Use more efficient ``thunks'' to implement C++ vtables. */ #undef DEFAULT_VTABLE_THUNKS -#define DEFAULT_VTABLE_THUNKS 2 +#define DEFAULT_VTABLE_THUNKS 1 /* Override the default comment-starter of "/". */ #undef ASM_COMMENT_START diff --git a/contrib/gcc/config/i386/freebsd.h.fixed b/contrib/gcc/config/i386/freebsd.h.fixed index 8c907bf9d1e4..e97d4ca07bb2 100644 --- a/contrib/gcc/config/i386/freebsd.h.fixed +++ b/contrib/gcc/config/i386/freebsd.h.fixed @@ -37,7 +37,7 @@ Boston, MA 02111-1307, USA. */ /* Use more efficient ``thunks'' to implement C++ vtables. */ #undef DEFAULT_VTABLE_THUNKS -#define DEFAULT_VTABLE_THUNKS 2 +#define DEFAULT_VTABLE_THUNKS 1 /* Override the default comment-starter of "/". */ #undef ASM_COMMENT_START diff --git a/contrib/gcc/cp/ChangeLog b/contrib/gcc/cp/ChangeLog index 59383dc9a95f..be101bac195f 100644 --- a/contrib/gcc/cp/ChangeLog +++ b/contrib/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +Fri Mar 16 12:46:19 GMT 2001 Bernd Schmidt (bernds@redhat.com) + + * gcc-2.95.3 Released. + Fri Jun 9 17:55:08 2000 Jeffrey A Law (law@cygnus.com) 2000-02-07 diff --git a/contrib/gcc/except.c b/contrib/gcc/except.c index cc6fc2913450..f7d78d687eff 100644 --- a/contrib/gcc/except.c +++ b/contrib/gcc/except.c @@ -723,42 +723,22 @@ static void receive_exception_label (handler_label) rtx handler_label; { - rtx around_label = NULL_RTX; - - if (! flag_new_exceptions || exceptions_via_longjmp) - { - around_label = gen_label_rtx (); - emit_jump (around_label); - emit_barrier (); - } - emit_label (handler_label); - if (! exceptions_via_longjmp) - { #ifdef HAVE_exception_receiver - if (HAVE_exception_receiver) - emit_insn (gen_exception_receiver ()); - else + if (! exceptions_via_longjmp) + if (HAVE_exception_receiver) + emit_insn (gen_exception_receiver ()); #endif -#ifdef HAVE_nonlocal_goto_receiver - if (HAVE_nonlocal_goto_receiver) - emit_insn (gen_nonlocal_goto_receiver ()); - else -#endif - { /* Nothing */ } - } - else - { -#ifndef DONT_USE_BUILTIN_SETJMP - expand_builtin_setjmp_receiver (handler_label); -#endif - } - if (around_label) - emit_label (around_label); +#ifdef HAVE_nonlocal_goto_receiver + if (! exceptions_via_longjmp) + if (HAVE_nonlocal_goto_receiver) + emit_insn (gen_nonlocal_goto_receiver ()); +#endif } + struct func_eh_entry { int range_number; /* EH region number from EH NOTE insn's */ @@ -1340,7 +1320,7 @@ static void start_dynamic_handler () { rtx dhc, dcc; - rtx arg, buf; + rtx x, arg, buf; int size; #ifndef DONT_USE_BUILTIN_SETJMP @@ -1382,17 +1362,18 @@ start_dynamic_handler () buf = plus_constant (XEXP (arg, 0), GET_MODE_SIZE (Pmode)*2); #ifdef DONT_USE_BUILTIN_SETJMP - { - rtx x; - x = emit_library_call_value (setjmp_libfunc, NULL_RTX, LCT_CONST, - TYPE_MODE (integer_type_node), 1, - buf, Pmode); - /* If we come back here for a catch, transfer control to the handler. */ - jumpif_rtx (x, ehstack.top->entry->exception_handler_label); - } + x = emit_library_call_value (setjmp_libfunc, NULL_RTX, 1, SImode, 1, + buf, Pmode); + /* If we come back here for a catch, transfer control to the handler. */ + jumpif_rtx (x, ehstack.top->entry->exception_handler_label); #else - expand_builtin_setjmp_setup (buf, - ehstack.top->entry->exception_handler_label); + { + /* A label to continue execution for the no exception case. */ + rtx noex = gen_label_rtx(); + x = expand_builtin_setjmp (buf, NULL_RTX, noex, + ehstack.top->entry->exception_handler_label); + emit_label (noex); + } #endif /* We are committed to this, so update the handler chain. */ diff --git a/contrib/gcc/expr.c b/contrib/gcc/expr.c index b8bcc86d5979..e3fe1f8f9f13 100644 --- a/contrib/gcc/expr.c +++ b/contrib/gcc/expr.c @@ -192,7 +192,6 @@ static rtx expand_builtin PROTO((tree, rtx, rtx, static int apply_args_size PROTO((void)); static int apply_result_size PROTO((void)); static rtx result_vector PROTO((int, rtx)); -static rtx expand_builtin_setjmp PROTO((tree, rtx)); static rtx expand_builtin_apply_args PROTO((void)); static rtx expand_builtin_apply PROTO((rtx, rtx, rtx)); static void expand_builtin_return PROTO((rtx)); @@ -8545,29 +8544,44 @@ expand_builtin_return_addr (fndecl_code, count, tem) return tem; } -/* Construct the leading half of a __builtin_setjmp call. Control will - return to RECEIVER_LABEL. This is used directly by sjlj exception - handling code. */ +/* __builtin_setjmp is passed a pointer to an array of five words (not + all will be used on all machines). It operates similarly to the C + library function of the same name, but is more efficient. Much of + the code below (and for longjmp) is copied from the handling of + non-local gotos. -void -expand_builtin_setjmp_setup (buf_addr, receiver_label) + NOTE: This is intended for use by GNAT and the exception handling + scheme in the compiler and will only work in the method used by + them. */ + +rtx +expand_builtin_setjmp (buf_addr, target, first_label, next_label) rtx buf_addr; - rtx receiver_label; + rtx target; + rtx first_label, next_label; { + rtx lab1 = gen_label_rtx (); enum machine_mode sa_mode = STACK_SAVEAREA_MODE (SAVE_NONLOCAL); + enum machine_mode value_mode; rtx stack_save; + value_mode = TYPE_MODE (integer_type_node); + #ifdef POINTERS_EXTEND_UNSIGNED buf_addr = convert_memory_address (Pmode, buf_addr); #endif buf_addr = force_reg (Pmode, buf_addr); + if (target == 0 || GET_CODE (target) != REG + || REGNO (target) < FIRST_PSEUDO_REGISTER) + target = gen_reg_rtx (value_mode); + emit_queue (); - /* We store the frame pointer and the address of receiver_label in - the buffer and use the rest of it for the stack save area, which - is machine-dependent. */ + /* We store the frame pointer and the address of lab1 in the buffer + and use the rest of it for the stack save area, which is + machine-dependent. */ #ifndef BUILTIN_SETJMP_FRAME_VALUE #define BUILTIN_SETJMP_FRAME_VALUE virtual_stack_vars_rtx @@ -8579,7 +8593,7 @@ expand_builtin_setjmp_setup (buf_addr, receiver_label) (gen_rtx_MEM (Pmode, plus_constant (buf_addr, GET_MODE_SIZE (Pmode)))), - force_reg (Pmode, gen_rtx_LABEL_REF (Pmode, receiver_label))); + force_reg (Pmode, gen_rtx_LABEL_REF (Pmode, lab1))); stack_save = gen_rtx_MEM (sa_mode, plus_constant (buf_addr, @@ -8592,22 +8606,20 @@ expand_builtin_setjmp_setup (buf_addr, receiver_label) emit_insn (gen_builtin_setjmp_setup (buf_addr)); #endif - /* Tell optimize_save_area_alloca that extra work is going to - need to go on during alloca. */ - current_function_calls_setjmp = 1; + /* Set TARGET to zero and branch to the first-time-through label. */ + emit_move_insn (target, const0_rtx); + emit_jump_insn (gen_jump (first_label)); + emit_barrier (); + emit_label (lab1); + + /* Tell flow about the strange goings on. Putting `lab1' on + `nonlocal_goto_handler_labels' to indicates that function + calls may traverse the arc back to this label. */ - /* Set this so all the registers get saved in our frame; we need to be - able to copy the saved values for any registers from frames we unwind. */ current_function_has_nonlocal_label = 1; -} + nonlocal_goto_handler_labels = + gen_rtx_EXPR_LIST (VOIDmode, lab1, nonlocal_goto_handler_labels); -/* Construct the trailing part of a __builtin_setjmp call. - This is used directly by sjlj exception handling code. */ - -void -expand_builtin_setjmp_receiver (receiver_label) - rtx receiver_label ATTRIBUTE_UNUSED; -{ /* Clobber the FP when we get here, so we have to make sure it's marked as used by this function. */ emit_insn (gen_rtx_USE (VOIDmode, hard_frame_pointer_rtx)); @@ -8654,7 +8666,7 @@ expand_builtin_setjmp_receiver (receiver_label) #ifdef HAVE_builtin_setjmp_receiver if (HAVE_builtin_setjmp_receiver) - emit_insn (gen_builtin_setjmp_receiver (receiver_label)); + emit_insn (gen_builtin_setjmp_receiver (lab1)); else #endif #ifdef HAVE_nonlocal_goto_receiver @@ -8666,67 +8678,11 @@ expand_builtin_setjmp_receiver (receiver_label) ; /* Nothing */ } - /* @@@ This is a kludge. Not all machine descriptions define a blockage - insn, but we must not allow the code we just generated to be reordered - by scheduling. Specifically, the update of the frame pointer must - happen immediately, not later. So emit an ASM_INPUT to act as blockage - insn. */ - emit_insn (gen_rtx_ASM_INPUT (VOIDmode, "")); -} - - -/* __builtin_setjmp is passed a pointer to an array of five words (not - all will be used on all machines). It operates similarly to the C - library function of the same name, but is more efficient. Much of - the code below (and for longjmp) is copied from the handling of - non-local gotos. - - NOTE: This is intended for use by GNAT and the exception handling - scheme in the compiler and will only work in the method used by - them. */ - -static rtx -expand_builtin_setjmp (arglist, target) - tree arglist; - rtx target; -{ - rtx buf_addr, next_lab, cont_lab; - - if (arglist == 0 - || TREE_CODE (TREE_TYPE (TREE_VALUE (arglist))) != POINTER_TYPE) - return NULL_RTX; - - if (target == 0 || GET_CODE (target) != REG - || REGNO (target) < FIRST_PSEUDO_REGISTER) - target = gen_reg_rtx (TYPE_MODE (integer_type_node)); - - buf_addr = expand_expr (TREE_VALUE (arglist), NULL_RTX, VOIDmode, 0); - - next_lab = gen_label_rtx (); - cont_lab = gen_label_rtx (); - - expand_builtin_setjmp_setup (buf_addr, next_lab); - - /* Set TARGET to zero and branch to the continue label. */ - emit_move_insn (target, const0_rtx); - emit_jump_insn (gen_jump (cont_lab)); - emit_barrier (); - emit_label (next_lab); - - expand_builtin_setjmp_receiver (next_lab); - - /* Set TARGET to one. */ + /* Set TARGET, and branch to the next-time-through label. */ emit_move_insn (target, const1_rtx); - emit_label (cont_lab); + emit_jump_insn (gen_jump (next_label)); + emit_barrier (); - /* Tell flow about the strange goings on. Putting `next_lab' on - `nonlocal_goto_handler_labels' to indicates that function - calls may traverse the arc back to this label. */ - - current_function_has_nonlocal_label = 1; - nonlocal_goto_handler_labels - = gen_rtx_EXPR_LIST (VOIDmode, next_lab, nonlocal_goto_handler_labels); - return target; } @@ -9747,10 +9703,18 @@ expand_builtin (exp, target, subtarget, mode, ignore) #endif case BUILT_IN_SETJMP: - target = expand_builtin_setjmp (arglist, target); - if (target) - return target; - break; + if (arglist == 0 + || TREE_CODE (TREE_TYPE (TREE_VALUE (arglist))) != POINTER_TYPE) + break; + else + { + rtx buf_addr = expand_expr (TREE_VALUE (arglist), subtarget, + VOIDmode, 0); + rtx lab = gen_label_rtx (); + rtx ret = expand_builtin_setjmp (buf_addr, target, lab, lab); + emit_label (lab); + return ret; + } /* __builtin_longjmp is passed a pointer to an array of five words. It's similar to the C library longjmp function but works with diff --git a/contrib/gcc/expr.h b/contrib/gcc/expr.h index c279774afe5d..55e82e6622d4 100644 --- a/contrib/gcc/expr.h +++ b/contrib/gcc/expr.h @@ -831,8 +831,7 @@ extern rtx store_expr PROTO((tree, rtx, int)); Useful after calling expand_expr with 1 as sum_ok. */ extern rtx force_operand PROTO((rtx, rtx)); -extern void expand_builtin_setjmp_setup PARAMS ((rtx, rtx)); -extern void expand_builtin_setjmp_receiver PARAMS ((rtx)); +extern rtx expand_builtin_setjmp PROTO((rtx, rtx, rtx, rtx)); #ifdef TREE_CODE /* Generate code for computing expression EXP. diff --git a/contrib/gcc/f/ChangeLog b/contrib/gcc/f/ChangeLog index 47a745e70fff..51c040e666ae 100644 --- a/contrib/gcc/f/ChangeLog +++ b/contrib/gcc/f/ChangeLog @@ -1,3 +1,7 @@ +Fri Mar 16 12:46:19 GMT 2001 Bernd Schmidt (bernds@redhat.com) + + * gcc-2.95.3 Released. + Mon Mar 13 01:00:55 2000 Toon Moene * stw.h (struct _ffestw_): Change type of uses_ to int. diff --git a/contrib/gcc/f/version.c b/contrib/gcc/f/version.c index 1b1cfd2bf968..4b695cdb3acd 100644 --- a/contrib/gcc/f/version.c +++ b/contrib/gcc/f/version.c @@ -1 +1 @@ -const char *ffe_version_string = "0.5.25 19991030 (prerelease)"; +const char *ffe_version_string = "0.5.25 20010315 (release)"; diff --git a/contrib/gcc/final.c b/contrib/gcc/final.c index a9ae2804dbde..11cfebf34624 100644 --- a/contrib/gcc/final.c +++ b/contrib/gcc/final.c @@ -3103,7 +3103,7 @@ alter_subreg (x) PUT_CODE (x, MEM); MEM_COPY_ATTRIBUTES (x, y); MEM_ALIAS_SET (x) = MEM_ALIAS_SET (y); - XEXP (x, 0) = plus_constant (XEXP (y, 0), offset); + XEXP (x, 0) = plus_constant_for_output (XEXP (y, 0), offset); } return x; diff --git a/contrib/gcc/varasm.c b/contrib/gcc/varasm.c index 56fe2ad96b84..b93506546bcf 100644 --- a/contrib/gcc/varasm.c +++ b/contrib/gcc/varasm.c @@ -3494,18 +3494,6 @@ force_const_mem (mode, x) pop_obstacks (); } - if (GET_CODE (x) == LABEL_REF) - { - extern rtx forced_labels; - - push_obstacks_nochange (); - rtl_in_saveable_obstack (); - - forced_labels = gen_rtx_EXPR_LIST (VOIDmode, - XEXP (x, 0), - forced_labels); - pop_obstacks (); - } /* Allocate a pool constant descriptor, fill it in, and chain it in. */ diff --git a/contrib/gcc/version.c b/contrib/gcc/version.c index 5c11bbbe33cd..474c4364a2c9 100644 --- a/contrib/gcc/version.c +++ b/contrib/gcc/version.c @@ -1 +1 @@ -char *version_string = "2.95.3 20010125 (prerelease)"; +char *version_string = "2.95.3 20010315 (release)";