From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2545 invoked by alias); 18 Feb 2002 09:53:31 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 2477 invoked from network); 18 Feb 2002 09:53:28 -0000 Received: from unknown (HELO dublin.ACT-Europe.FR) (212.157.227.154) by sources.redhat.com with SMTP; 18 Feb 2002 09:53:28 -0000 Received: from berlin.ACT-Europe.FR (berlin.act-europe.fr [212.157.227.169]) by dublin.ACT-Europe.FR (Postfix) with ESMTP id B5353229E46; Mon, 18 Feb 2002 10:53:27 +0100 (MET) Received: by berlin.ACT-Europe.FR (Postfix, from userid 546) id 934B490E; Mon, 18 Feb 2002 10:53:26 +0100 (CET) To: "John David Anglin" Cc: law@redhat.com, gcc-patches@gcc.gnu.org Subject: Re: Don't use lib2funcs.asm on PA References: <200202171855.g1HItAto010304@hiauly1.hia.nrc.ca> From: Olivier Hainque Date: Mon, 18 Feb 2002 03:21:00 -0000 In-Reply-To: <200202171855.g1HItAto010304@hiauly1.hia.nrc.ca> Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-02/txt/msg01191.txt.bz2 "John David Anglin" writes: > Yes, looked at dwarf2out.c to see what it expects. I found some more > coding problems with PARALLEL's in the register save code and also that > the EH_RETURN_DATA_REGNO registers need to be saved if the function > calls eh_return. Indeed. This is part of what we use for pa-hpux that I mentioned was not in a submittable state yet. > However, there is a problem in the catch. It is very likely that what you are seeing is related to some problems we also "experimented". In the current state of things, we have added an eh_return pattern to the machine description and a "for_eh_return" argument to hppa_expand_epilogue. Below is part of our patch that might well be of interest for your immediate troubles. This part is not applicable as is but should give an idea of the kind of things we had to add to get things working (basically, emitting the stack adjustment and not restoring r2 in eh return epilogue). I did not include/submit the complete version yet because it still needs further testing, comments and partial reorg, but if you think it could be useful to see, I'd be happy to post and discuss it. Kind Regards, Olivier *************** pa_output_function_epilogue (file, size) *** 3390,3409 **** } void ! hppa_expand_epilogue () { rtx tmpreg; int offset, i; int merge_sp_adjust_with_load = 0; int ret_off = 0; /* We will use this often. */ tmpreg = gen_rtx_REG (word_mode, 1); /* Try to restore RP early to avoid load/use interlocks when RP gets used in the return (bv) instruction. This appears to still be necessary even when we schedule the prologue and epilogue. */ ! if (regs_ever_live [2]) { ret_off = TARGET_64BIT ? -16 : -20; if (frame_pointer_needed) --- 3504,3533 ---- } void ! hppa_expand_epilogue (int for_eh_return) { rtx tmpreg; int offset, i; int merge_sp_adjust_with_load = 0; int ret_off = 0; + /* Compute the frame sizes now if running for eh_return since expand + prologue has not been called yet. */ + if (for_eh_return) + { + int size = get_frame_size (); + + local_fsize = adjusted_frame_size_for (size); + actual_fsize = compute_frame_size (size, &save_fregs); + } + /* We will use this often. */ tmpreg = gen_rtx_REG (word_mode, 1); /* Try to restore RP early to avoid load/use interlocks when RP gets used in the return (bv) instruction. This appears to still be necessary even when we schedule the prologue and epilogue. */ ! if ((regs_ever_live [2] || flag_exceptions) && !for_eh_return) { ret_off = TARGET_64BIT ? -16 : -20; if (frame_pointer_needed) *************** hppa_expand_epilogue () *** 3524,3531 **** /* If we haven't restored %r2 yet (no frame pointer, and a stack frame greater than 8k), do so now. */ ! if (ret_off != 0) load_reg (2, ret_off, STACK_POINTER_REGNUM); } rtx --- 3686,3703 ---- /* If we haven't restored %r2 yet (no frame pointer, and a stack frame greater than 8k), do so now. */ ! if (ret_off != 0 && !for_eh_return) load_reg (2, ret_off, STACK_POINTER_REGNUM); + + /* Emit the stack adjustment for the jump to handler case. */ + if (for_eh_return) + { + emit_move_insn + (gen_rtx_REG (Pmode, STACK_POINTER_REGNUM), + gen_rtx_MINUS (Pmode, + gen_rtx_REG (Pmode, STACK_POINTER_REGNUM), + EH_RETURN_STACKADJ_RTX)); + } } rtx