From patchwork Fri Oct 21 15:36:41 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georg-Johann Lay X-Patchwork-Id: 121005 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 5A2C11007D1 for ; Sat, 22 Oct 2011 02:37:15 +1100 (EST) Received: (qmail 1052 invoked by alias); 21 Oct 2011 15:37:09 -0000 Received: (qmail 979 invoked by uid 22791); 21 Oct 2011 15:37:06 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_NONE, TW_IY X-Spam-Check-By: sourceware.org Received: from mo-p00-ob.rzone.de (HELO mo-p00-ob.rzone.de) (81.169.146.162) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 21 Oct 2011 15:36:52 +0000 X-RZG-AUTH: :LXoWVUeid/7A29J/hMvvT2k715jHQaJercGObUOFkj18odoYNahU4Q== X-RZG-CLASS-ID: mo00 Received: from [192.168.0.22] (business-188-111-022-002.static.arcor-ip.net [188.111.22.2]) by smtp.strato.de (klopstock mo9) (RZmta 26.10 AUTH) with ESMTPA id m07043n9LEQ2CX ; Fri, 21 Oct 2011 17:36:41 +0200 (MEST) Message-ID: <4EA19189.6020402@gjlay.de> Date: Fri, 21 Oct 2011 17:36:41 +0200 From: Georg-Johann Lay User-Agent: Thunderbird 2.0.0.24 (X11/20100302) MIME-Version: 1.0 To: gcc-patches@gcc.gnu.org CC: Eric Weddington Subject: [Patch,AVR]: Fix thinko in LEGITIMIZE_RELOAD_ADDRESS X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org This fixes avr_legitimize_reload_address: Since breaking out the code from LEGITIMIZE_RELOAD_ADDRESS, protiype of above is avr_legitimize_reload_address (rtx x, ... but must be avr_legitimize_reload_address (rtx *px, ... because at one place &x is used as input to push_reload which is now px. Ok to install? Johann * config/avr/avr.h (LEGITIMIZE_RELOAD_ADDRESS): Pass address of X instead of X to avr_legitimize_reload_address. * config/avr/avr-protos.h (avr_legitimize_reload_address): Change first arrument from rtx to rtx*. * config/avr/avr.c (avr_legitimize_reload_address): Ditto. Pass PX to push_reload instead of &X. Change log messages for better distinction. Index: config/avr/avr-protos.h =================================================================== --- config/avr/avr-protos.h (revision 180298) +++ config/avr/avr-protos.h (working copy) @@ -110,7 +110,7 @@ extern void out_shift_with_cnt (const ch extern reg_class_t avr_mode_code_base_reg_class (enum machine_mode, RTX_CODE, RTX_CODE); extern bool avr_regno_mode_code_ok_for_base_p (int, enum machine_mode, RTX_CODE, RTX_CODE); extern rtx avr_incoming_return_addr_rtx (void); -extern rtx avr_legitimize_reload_address (rtx, enum machine_mode, int, int, int, int, rtx (*)(rtx,int)); +extern rtx avr_legitimize_reload_address (rtx*, enum machine_mode, int, int, int, int, rtx (*)(rtx,int)); #endif /* RTX_CODE */ #ifdef REAL_VALUE_TYPE Index: config/avr/avr.c =================================================================== --- config/avr/avr.c (revision 180298) +++ config/avr/avr.c (working copy) @@ -1356,11 +1356,13 @@ avr_legitimize_address (rtx x, rtx oldx, than 63 bytes or for R++ or --R addressing. */ rtx -avr_legitimize_reload_address (rtx x, enum machine_mode mode, +avr_legitimize_reload_address (rtx *px, enum machine_mode mode, int opnum, int type, int addr_type, int ind_levels ATTRIBUTE_UNUSED, rtx (*mk_memloc)(rtx,int)) { + rtx x = *px; + if (avr_log.legitimize_reload_address) avr_edump ("\n%?:%m %r\n", mode, x); @@ -1372,7 +1374,7 @@ avr_legitimize_reload_address (rtx x, en opnum, RELOAD_OTHER); if (avr_log.legitimize_reload_address) - avr_edump (" RCLASS = %R\n IN = %r\n OUT = %r\n", + avr_edump (" RCLASS.1 = %R\n IN = %r\n OUT = %r\n", POINTER_REGS, XEXP (x, 0), XEXP (x, 0)); return x; @@ -1398,7 +1400,7 @@ avr_legitimize_reload_address (rtx x, en 1, addr_type); if (avr_log.legitimize_reload_address) - avr_edump (" RCLASS = %R\n IN = %r\n OUT = %r\n", + avr_edump (" RCLASS.2 = %R\n IN = %r\n OUT = %r\n", POINTER_REGS, XEXP (mem, 0), NULL_RTX); push_reload (mem, NULL_RTX, &XEXP (x, 0), NULL, @@ -1406,7 +1408,7 @@ avr_legitimize_reload_address (rtx x, en opnum, type); if (avr_log.legitimize_reload_address) - avr_edump (" RCLASS = %R\n IN = %r\n OUT = %r\n", + avr_edump (" RCLASS.2 = %R\n IN = %r\n OUT = %r\n", BASE_POINTER_REGS, mem, NULL_RTX); return x; @@ -1415,12 +1417,12 @@ avr_legitimize_reload_address (rtx x, en else if (! (frame_pointer_needed && XEXP (x, 0) == frame_pointer_rtx)) { - push_reload (x, NULL_RTX, &x, NULL, + push_reload (x, NULL_RTX, px, NULL, POINTER_REGS, GET_MODE (x), VOIDmode, 0, 0, opnum, type); if (avr_log.legitimize_reload_address) - avr_edump (" RCLASS = %R\n IN = %r\n OUT = %r\n", + avr_edump (" RCLASS.3 = %R\n IN = %r\n OUT = %r\n", POINTER_REGS, x, NULL_RTX); return x; Index: config/avr/avr.h =================================================================== --- config/avr/avr.h (revision 180298) +++ config/avr/avr.h (working copy) @@ -375,7 +375,7 @@ typedef struct avr_args { #define LEGITIMIZE_RELOAD_ADDRESS(X,MODE,OPNUM,TYPE,IND_L,WIN) \ do { \ - rtx new_x = avr_legitimize_reload_address (X, MODE, OPNUM, TYPE, \ + rtx new_x = avr_legitimize_reload_address (&(X), MODE, OPNUM, TYPE, \ ADDR_TYPE (TYPE), \ IND_L, make_memloc); \ if (new_x) \