From patchwork Thu Sep 20 00:33:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dehao Chen X-Patchwork-Id: 185271 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 7747D2C0085 for ; Thu, 20 Sep 2012 10:33:55 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1348706035; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: MIME-Version:Received:Received:In-Reply-To:References:Date: Message-ID:Subject:From:To:Content-Type:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=4Rbr7qOoibU2+s9WsWz88GfRr6E=; b=cHaM5WVpe9jT0wV Fgx7A8KgVBF5UrueRfkh3xqdlARF8dlHirYGXPisrK9/2Juwwp7oULmEupIJioFO NR0WV6j02SSUYsxWXxpj8zAzrigv8n1ZJEnuILUQIhHaVfJ6p/em645WGGeor3S5 0CfQnJW/SS6tseNXO2GwCkzeS498= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:X-Google-DKIM-Signature:Received:MIME-Version:Received:Received:In-Reply-To:References:Date:Message-ID:Subject:From:To:Content-Type:X-System-Of-Record:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=C3w9yxndYUKWGZIFP//bmYoOsI/9htMqHsWsyzutWVPm2YxaSyM0A1jkydQepI aJQE8GmZIO/LKXWIkVOhhCIV76RW1wgpUSN2e4EBaP3ZcgidkMXKYtJVlQeK2lMq kdAMlvJmBFklKeFmGh4lXafiNyQyq71bSApda/N2ebNtM=; Received: (qmail 3164 invoked by alias); 20 Sep 2012 00:33:51 -0000 Received: (qmail 3152 invoked by uid 22791); 20 Sep 2012 00:33:50 -0000 X-SWARE-Spam-Status: No, hits=-6.0 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KHOP_RCVD_TRUST, KHOP_THREADED, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-pb0-f47.google.com (HELO mail-pb0-f47.google.com) (209.85.160.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 20 Sep 2012 00:33:36 +0000 Received: by pbcwy7 with SMTP id wy7so4039064pbc.20 for ; Wed, 19 Sep 2012 17:33:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:x-system-of-record:x-gm-message-state; bh=Abj4fFKs/6XqS8ZYcSodGpUMrk50fqboX277Mvxk/rU=; b=Hcysrn2r5xw+8505HkaV3gnhC+nAuD1emG3D0SO5HLoYTPmH8WB6n9SR7X13pU/mGB vAjEl9J4Pz2OyJMjfAv9RgVoBOvvEnny71HRbnjOvaIf48gKJD6qbwBsNR52FxxoO3DC K/j/Fxq2mpbsln27yxiKc/2UIce5KqtA1yzbPNrrnWP0LQGQmkIHOP3WJPTmtAUlmAWT UN/1ygOvuIEAFbSY7sP08ZkT7IpV3hNk4jcPag7ANHJ6SS5bpofhnpvjU1p4eaZfhh3Z TcHzbGeWqdYcNmW5Th66Mkg6dXFm+azRnujFSFWd8sdmDO+1HjuyN/fMCV+KwtWnc9vH 2qcg== Received: by 10.66.82.101 with SMTP id h5mr1276176pay.15.1348101215881; Wed, 19 Sep 2012 17:33:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.66.82.101 with SMTP id h5mr1276151pay.15.1348101215787; Wed, 19 Sep 2012 17:33:35 -0700 (PDT) Received: by 10.68.200.41 with HTTP; Wed, 19 Sep 2012 17:33:35 -0700 (PDT) In-Reply-To: References: <5049D5AD.5010405@google!.com> <87sjal3m22.fsf@fleche.redhat.com> <20120919222904.GA3831@ibm-tiger.the-meissners.org> Date: Thu, 20 Sep 2012 08:33:35 +0800 Message-ID: Subject: Re: [PATCH] Combine location with block using block_locations From: Dehao Chen To: Michael Meissner , Dehao Chen , Tom Tromey , Diego Novillo , Richard Guenther , Dodji Seketeli , GCC Patches , Jakub Jelinek , Jan Hubicka , David Li , Jason Merrill , Richard Henderson X-System-Of-Record: true X-Gm-Message-State: ALoCoQlVV5OCIURjIfSR1o8mdg3ljktm1Ke/C8au/zK0o+Zo3OiBQ9sBGTVDFD+TrGZJUrTp21tIFhrROg7NaLD7iLZadYOzkLKEigpBKxXuLmb+XZE7Zwck2+zCO48GN2Oefbv64lc61iaZJ90qiLhYu5rSm8ONg61udqcDIME+QFPoB4DmrE2jSCHMR46Xh/Y2egzAG8nl 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 The patch to fix this problem is attached. As I don't have machines other than x86, I cannot test it. But this patch seemed straightforward. I'll check it in in a couple of hours if no objection is received. Thanks, Dehao gcc/ChangeLog: 2012-09-19 Dehao Chen * config/s390/s390.c (s390_chunkify_start): Replacing INSN_LOCATOR. * config/spu/spu.c (emit_nop_for_insn): Likewise. (pad_bb): Likewise. (spu_emit_branch_hint): Likewise. (insert_hbrp_for_ilb_runout): Likewise. * config/mep/mep.c (mep_make_bundle): Likewise. (mep_bundle_insns): Likewise. * config/sh/sh.c (gen_block_redirect): Likewise. * config/c6x/c6x.c (gen_one_bundle): Likewise. * config/rs6000/rs6000.c (rs6000_final_prescan_insn): Likewise. * config/picochip/picochip.c (picochip_reorg): Likewise. * config/arm/arm.c (require_pic_register): Likewise. * config/mips/mips.c (mips16_gp_pseudo_reg): Likewise. * config/bfin/bfin.c (gen_one_bundle): Likewise. Index: gcc/config/s390/s390.c =================================================================== --- gcc/config/s390/s390.c (revision 191494) +++ gcc/config/s390/s390.c (working copy) @@ -6869,7 +6869,7 @@ s390_chunkify_start (void) prev = prev_nonnote_insn (prev); if (prev) jump = emit_jump_insn_after_setloc (gen_jump (label), insn, - INSN_LOCATOR (prev)); + INSN_LOCATION (prev)); else jump = emit_jump_insn_after_noloc (gen_jump (label), insn); barrier = emit_barrier_after (jump); Index: gcc/config/spu/spu.c =================================================================== --- gcc/config/spu/spu.c (revision 191494) +++ gcc/config/spu/spu.c (working copy) @@ -1998,7 +1998,7 @@ emit_nop_for_insn (rtx insn) else new_insn = emit_insn_after (gen_lnop (), insn); recog_memoized (new_insn); - INSN_LOCATOR (new_insn) = INSN_LOCATOR (insn); + INSN_LOCATION (new_insn) = INSN_LOCATION (insn); } /* Insert nops in basic blocks to meet dual issue alignment @@ -2037,7 +2037,7 @@ pad_bb(void) prev_insn = emit_insn_before (gen_lnop (), insn); PUT_MODE (prev_insn, GET_MODE (insn)); PUT_MODE (insn, TImode); - INSN_LOCATOR (prev_insn) = INSN_LOCATOR (insn); + INSN_LOCATION (prev_insn) = INSN_LOCATION (insn); length += 4; } } @@ -2106,7 +2106,7 @@ spu_emit_branch_hint (rtx before, rtx branch, rtx hint = emit_insn_before (gen_hbr (branch_label, target), before); recog_memoized (hint); - INSN_LOCATOR (hint) = INSN_LOCATOR (branch); + INSN_LOCATION (hint) = INSN_LOCATION (branch); HINTED_P (branch) = 1; if (GET_CODE (target) == LABEL_REF) @@ -2129,7 +2129,7 @@ spu_emit_branch_hint (rtx before, rtx branch, rtx which could make it too far for the branch offest to fit */ insn = emit_insn_before (gen_blockage (), hint); recog_memoized (insn); - INSN_LOCATOR (insn) = INSN_LOCATOR (hint); + INSN_LOCATION (insn) = INSN_LOCATION (hint); } else if (distance <= 8 * 4) { @@ -2141,20 +2141,20 @@ spu_emit_branch_hint (rtx before, rtx branch, rtx insn = emit_insn_after (gen_nopn_nv (gen_rtx_REG (SImode, 127)), hint); recog_memoized (insn); - INSN_LOCATOR (insn) = INSN_LOCATOR (hint); + INSN_LOCATION (insn) = INSN_LOCATION (hint); } /* Make sure any nops inserted aren't scheduled before the hint. */ insn = emit_insn_after (gen_blockage (), hint); recog_memoized (insn); - INSN_LOCATOR (insn) = INSN_LOCATOR (hint); + INSN_LOCATION (insn) = INSN_LOCATION (hint); /* Make sure any nops inserted aren't scheduled after the call. */ if (CALL_P (branch) && distance < 8 * 4) { insn = emit_insn_before (gen_blockage (), branch); recog_memoized (insn); - INSN_LOCATOR (insn) = INSN_LOCATOR (branch); + INSN_LOCATION (insn) = INSN_LOCATION (branch); } } } @@ -2340,7 +2340,7 @@ insert_hbrp_for_ilb_runout (rtx first) insn = emit_insn_before (gen_iprefetch (GEN_INT (1)), before_4); recog_memoized (insn); - INSN_LOCATOR (insn) = INSN_LOCATOR (before_4); + INSN_LOCATION (insn) = INSN_LOCATION (before_4); INSN_ADDRESSES_NEW (insn, INSN_ADDRESSES (INSN_UID (before_4))); PUT_MODE (insn, GET_MODE (before_4)); @@ -2349,7 +2349,7 @@ insert_hbrp_for_ilb_runout (rtx first) { insn = emit_insn_before (gen_lnop (), before_4); recog_memoized (insn); - INSN_LOCATOR (insn) = INSN_LOCATOR (before_4); + INSN_LOCATION (insn) = INSN_LOCATION (before_4); INSN_ADDRESSES_NEW (insn, INSN_ADDRESSES (INSN_UID (before_4))); PUT_MODE (insn, TImode); @@ -2361,7 +2361,7 @@ insert_hbrp_for_ilb_runout (rtx first) insn = emit_insn_before (gen_iprefetch (GEN_INT (2)), before_16); recog_memoized (insn); - INSN_LOCATOR (insn) = INSN_LOCATOR (before_16); + INSN_LOCATION (insn) = INSN_LOCATION (before_16); INSN_ADDRESSES_NEW (insn, INSN_ADDRESSES (INSN_UID (before_16))); PUT_MODE (insn, GET_MODE (before_16)); @@ -2370,7 +2370,7 @@ insert_hbrp_for_ilb_runout (rtx first) { insn = emit_insn_before (gen_lnop (), before_16); recog_memoized (insn); - INSN_LOCATOR (insn) = INSN_LOCATOR (before_16); + INSN_LOCATION (insn) = INSN_LOCATION (before_16); INSN_ADDRESSES_NEW (insn, INSN_ADDRESSES (INSN_UID (before_16))); Index: gcc/config/mep/mep.c =================================================================== --- gcc/config/mep/mep.c (revision 191494) +++ gcc/config/mep/mep.c (working copy) @@ -6814,9 +6814,9 @@ mep_make_bundle (rtx core, rtx cop) /* Derive a location for the bundle. Individual instructions cannot have their own location because there can be no assembler labels between CORE and COP. */ - INSN_LOCATOR (insn) = INSN_LOCATOR (INSN_LOCATOR (core) ? core : cop); - INSN_LOCATOR (core) = 0; - INSN_LOCATOR (cop) = 0; + INSN_LOCATION (insn) = INSN_LOCATION (INSN_LOCATION (core) ? core : cop); + INSN_LOCATION (core) = 0; + INSN_LOCATION (cop) = 0; return insn; } @@ -6913,7 +6913,7 @@ mep_bundle_insns (rtx insns) whenever the current line changes, set the location info for INSN to match FIRST. */ - INSN_LOCATOR (insn) = INSN_LOCATOR (first); + INSN_LOCATION (insn) = INSN_LOCATION (first); note = PREV_INSN (insn); while (note && note != first) Index: gcc/config/sh/sh.c =================================================================== --- gcc/config/sh/sh.c (revision 191494) +++ gcc/config/sh/sh.c (working copy) @@ -5530,7 +5530,7 @@ gen_block_redirect (rtx jump, int addr, int need_b NOTE_INSN_BLOCK_END notes between the indirect_jump_scratch and the jump. */ - INSN_LOCATOR (insn) = INSN_LOCATOR (jump); + INSN_LOCATION (insn) = INSN_LOCATION (jump); INSN_CODE (insn) = CODE_FOR_indirect_jump_scratch; return insn; } Index: gcc/config/c6x/c6x.c =================================================================== --- gcc/config/c6x/c6x.c (revision 191494) +++ gcc/config/c6x/c6x.c (working copy) @@ -4595,7 +4595,7 @@ gen_one_bundle (rtx *slot, int n_filled, int real_ bundle = gen_rtx_SEQUENCE (VOIDmode, gen_rtvec_v (n_filled, slot)); bundle = make_insn_raw (bundle); BLOCK_FOR_INSN (bundle) = BLOCK_FOR_INSN (slot[0]); - INSN_LOCATOR (bundle) = INSN_LOCATOR (slot[0]); + INSN_LOCATION (bundle) = INSN_LOCATION (slot[0]); PREV_INSN (bundle) = PREV_INSN (slot[real_first]); t = NULL_RTX; @@ -4609,7 +4609,7 @@ gen_one_bundle (rtx *slot, int n_filled, int real_ NEXT_INSN (t) = insn; t = insn; if (i > 0) - INSN_LOCATOR (slot[i]) = INSN_LOCATOR (bundle); + INSN_LOCATION (slot[i]) = INSN_LOCATION (bundle); } NEXT_INSN (bundle) = NEXT_INSN (PREV_INSN (bundle)); Index: gcc/config/rs6000/rs6000.c =================================================================== --- gcc/config/rs6000/rs6000.c (revision 191494) +++ gcc/config/rs6000/rs6000.c (working copy) @@ -27351,7 +27351,7 @@ rs6000_final_prescan_insn (rtx insn, rtx *operand { const char *temp; int insn_code_number = recog_memoized (insn); - location_t location = locator_location (INSN_LOCATOR (insn)); + location_t location = INSN_LOCATION (insn); /* Punt on insns we cannot recognize. */ if (insn_code_number < 0) Index: gcc/config/picochip/picochip.c =================================================================== --- gcc/config/picochip/picochip.c (revision 191494) +++ gcc/config/picochip/picochip.c (working copy) @@ -3298,16 +3298,16 @@ picochip_reorg (void) if (GET_MODE (insn) == TImode) { vliw_start = insn; - vliw_insn_location = INSN_LOCATOR (insn); + vliw_insn_location = INSN_LOCATION (insn); } if (JUMP_P (insn) || CALL_P(insn)) { - vliw_insn_location = INSN_LOCATOR (insn); + vliw_insn_location = INSN_LOCATION (insn); for (insn1 = vliw_start; insn1 != insn ; insn1 = next_real_insn (insn1)) - INSN_LOCATOR (insn1) = vliw_insn_location; + INSN_LOCATION (insn1) = vliw_insn_location; } /* Tag subsequent instructions with the same location. */ - INSN_LOCATOR (insn) = vliw_insn_location; + INSN_LOCATION (insn) = vliw_insn_location; } } Index: gcc/config/arm/arm.c =================================================================== --- gcc/config/arm/arm.c (revision 191494) +++ gcc/config/arm/arm.c (working copy) @@ -5359,7 +5359,7 @@ require_pic_register (void) for (insn = seq; insn; insn = NEXT_INSN (insn)) if (INSN_P (insn)) - INSN_LOCATOR (insn) = prologue_locator; + INSN_LOCATION (insn) = prologue_location; /* We can be called during expansion of PHI nodes, where we can't yet emit instructions directly in the final Index: gcc/config/mips/mips.c =================================================================== --- gcc/config/mips/mips.c (revision 191494) +++ gcc/config/mips/mips.c (working copy) @@ -2628,7 +2628,7 @@ mips16_gp_pseudo_reg (void) insn = gen_load_const_gp (cfun->machine->mips16_gp_pseudo_rtx); insn = emit_insn_after (insn, scan); - INSN_LOCATOR (insn) = 0; + INSN_LOCATION (insn) = 0; pop_topmost_sequence (); } Index: gcc/config/bfin/bfin.c =================================================================== --- gcc/config/bfin/bfin.c (revision 191494) +++ gcc/config/bfin/bfin.c (working copy) @@ -3918,12 +3918,12 @@ gen_one_bundle (rtx slot[3]) } /* Avoid line number information being printed inside one bundle. */ - if (INSN_LOCATOR (slot[1]) - && INSN_LOCATOR (slot[1]) != INSN_LOCATOR (slot[0])) - INSN_LOCATOR (slot[1]) = INSN_LOCATOR (slot[0]); - if (INSN_LOCATOR (slot[2]) - && INSN_LOCATOR (slot[2]) != INSN_LOCATOR (slot[0])) - INSN_LOCATOR (slot[2]) = INSN_LOCATOR (slot[0]); + if (INSN_LOCATION (slot[1]) + && INSN_LOCATION (slot[1]) != INSN_LOCATION (slot[0])) + INSN_LOCATION (slot[1]) = INSN_LOCATION (slot[0]); + if (INSN_LOCATION (slot[2]) + && INSN_LOCATION (slot[2]) != INSN_LOCATION (slot[0])) + INSN_LOCATION (slot[2]) = INSN_LOCATION (slot[0]); /* Terminate them with "|| " instead of ";" in the output. */ PUT_MODE (slot[0], SImode);