From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6431 invoked by alias); 23 Jan 2013 18:43:27 -0000 Received: (qmail 6403 invoked by uid 22791); 23 Jan 2013 18:43:23 -0000 X-SWARE-Spam-Status: No, hits=-7.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 23 Jan 2013 18:43:15 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0NIhE5u015641 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 23 Jan 2013 13:43:14 -0500 Received: from Mair.local (vpn-56-206.rdu2.redhat.com [10.10.56.206]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r0NIhDa7002231; Wed, 23 Jan 2013 13:43:13 -0500 Message-ID: <51002F41.8090005@redhat.com> Date: Wed, 23 Jan 2013 18:43:00 -0000 From: Vladimir Makarov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: Steven Bosscher CC: GCC Patches , Jakub Jelinek Subject: Re: [patch] PR inline-asm/55934 References: <50F9E596.7000100@redhat.com> <50FD6B5D.7040008@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2013-01/txt/msg01168.txt.bz2 On 13-01-22 4:41 AM, Steven Bosscher wrote: > On Mon, Jan 21, 2013 at 5:22 PM, Vladimir Makarov wrote: >> I'd prefer the above change than just keeping >> lra_invalidate_insn_data call. I think it is more safe solution for other >> parts of LRA code. > I agree, but unfortunately the compiler does not... > > With that lra.c change, I get extra fails: > > +FAIL: gcc.target/i386/20011029-2.c (internal compiler error) > +FAIL: gcc.target/i386/20011029-2.c (test for excess errors) > +FAIL: gcc.target/i386/pr21291.c (internal compiler error) > +FAIL: gcc.target/i386/pr21291.c (test for excess errors) > > These are constrain_operands(1) failures in check_rtl. Apparently some > relevant info is lost in lra_update_insn_recog_data. Not sure how to > debug this... > Steven, sorry for the delay with the answer. I was busy with other things. The error occurs because a pseudo in asm insn is not changed into hard register as the pseudo info is incorrect after info updating. You should just use lra_update_insn_regno_info. The patch (and the patch is ok to commit) should look like Index: lra-assigns.c =================================================================== --- lra-assigns.c (revision 195278) +++ lra-assigns.c (working copy) @@ -1240,6 +1240,23 @@ assign_by_spills (void) asm_p = true; error_for_asm (insn, "% operand has impossible constraints"); + /* Avoid further trouble with this insn. + For asm goto, instead of fixing up all the edges + just clear the template and clear input operands + (asm goto doesn't have any output operands). */ + if (JUMP_P (insn)) + { + rtx asm_op = extract_asm_operands (PATTERN (insn)); + ASM_OPERANDS_TEMPLATE (asm_op) = ggc_strdup (""); + ASM_OPERANDS_INPUT_VEC (asm_op) = rtvec_alloc (0); + ASM_OPERANDS_INPUT_CONSTRAINT_VEC (asm_op) = rtvec_alloc (0); + lra_update_insn_regno_info (insn); + } + else + { + PATTERN (insn) = gen_rtx_USE (VOIDmode, const0_rtx); + lra_set_insn_deleted (insn); + } } } lra_assert (asm_p); @@ -1263,6 +1280,9 @@ assign_by_spills (void) bitmap_ior_into (&changed_insns, &lra_reg_info[sorted_pseudos[i]].insn_bitmap); } + + /* FIXME: Look up the changed insns in the cached LRA insn data using + an EXECUTE_IF_SET_IN_BITMAP over changed_insns. */ FOR_EACH_BB (bb) FOR_BB_INSNS (bb, insn) if (bitmap_bit_p (&changed_insns, INSN_UID (insn))) Index: lra-constraints.c =================================================================== --- lra-constraints.c (revision 195322) +++ lra-constraints.c (working copy) @@ -1847,11 +1847,27 @@ process_alt_operands (int only_alternati int const_to_mem = 0; bool no_regs_p; + /* If this alternative asks for a specific reg class, see if there + is at least one allocatable register in that class. */ no_regs_p = (this_alternative == NO_REGS || (hard_reg_set_subset_p (reg_class_contents[this_alternative], lra_no_alloc_regs))); + + /* For asms, verify that the class for this alternative is possible + for the mode that is specified. */ + if (!no_regs_p && REG_P (op) && INSN_CODE (curr_insn) < 0) + { + int i; + for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) + if (HARD_REGNO_MODE_OK (i, mode) + && in_hard_reg_set_p (reg_class_contents[this_alternative], mode, i)) + break; + if (i == FIRST_PSEUDO_REGISTER) + winreg = false; + } + /* If this operand accepts a register, and if the register class has at least one allocatable register, then this operand can be reloaded. */ @@ -2742,10 +2758,6 @@ curr_insn_transform (void) swap_operands (commutative); } - /* The operands don't meet the constraints. goal_alt describes the - alternative that we could reach by reloading the fewest operands. - Reload so as to fit it. */ - if (! alt_p && ! sec_mem_p) { /* No alternative works with reloads?? */