From patchwork Tue Sep 6 09:05:16 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 113513 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 2B4EAB6F7C for ; Tue, 6 Sep 2011 19:06:48 +1000 (EST) Received: (qmail 22519 invoked by alias); 6 Sep 2011 09:06:43 -0000 Received: (qmail 22505 invoked by uid 22791); 6 Sep 2011 09:06:42 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_FAIL X-Spam-Check-By: sourceware.org Received: from smtp-vbr15.xs4all.nl (HELO smtp-vbr15.xs4all.nl) (194.109.24.35) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 06 Sep 2011 09:06:24 +0000 Received: from [192.168.1.68] (teejay.xs4all.nl [213.84.119.160]) (authenticated bits=0) by smtp-vbr15.xs4all.nl (8.13.8/8.13.8) with ESMTP id p8695sM8074607 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 6 Sep 2011 11:06:01 +0200 (CEST) (envelope-from vries@codesourcery.com) Message-ID: <4E65E24C.8050402@codesourcery.com> Date: Tue, 06 Sep 2011 11:05:16 +0200 From: Tom de Vries User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.21) Gecko/20110831 Lightning/1.0b2 Thunderbird/3.1.13 MIME-Version: 1.0 To: Jakub Jelinek CC: Eric Botcazou , "gcc-patches@gcc.gnu.org" Subject: Re: rtl_verify_flow_info fix References: <4E64885E.7040406@codesourcery.com> <20110905085300.GZ2687@tyan-ft48-01.lab.bos.redhat.com> <4E64C124.4090507@codesourcery.com> <20110905124659.GB2687@tyan-ft48-01.lab.bos.redhat.com> In-Reply-To: <20110905124659.GB2687@tyan-ft48-01.lab.bos.redhat.com> 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 On 09/05/2011 02:46 PM, Jakub Jelinek wrote: > On Mon, Sep 05, 2011 at 02:31:32PM +0200, Tom de Vries wrote: >> --- gcc/recog.c (revision 178145) >> +++ gcc/recog.c (working copy) >> @@ -118,6 +118,46 @@ init_recog (void) >> } >> >> >> +/* Return true if labels in asm operands BODY are LABEL_REFs. */ >> + >> +static bool >> +asm_labels_ok (rtx body) >> +{ >> + rtx first, asmop = NULL; >> + int i; > > asmop = extract_asm_operands (body); > > if (asmop == NULL) > return true; > ? > > I'd say you don't need to call asm_noperands after it. Yes, that's better. > > Jakub bootstrapped and regtested on x86_64, build and regtested on arm. OK for trunk? Thanks, - Tom 2011-09-06 Tom de Vries * recog.c (asm_labels_ok): New function. (check_asm_operands): Use asm_labels_ok. Index: gcc/recog.c =================================================================== --- gcc/recog.c (revision 178145) +++ gcc/recog.c (working copy) @@ -118,6 +118,25 @@ init_recog (void) } +/* Return true if labels in asm operands BODY are LABEL_REFs. */ + +static bool +asm_labels_ok (rtx body) +{ + rtx asmop; + int i; + + asmop = extract_asm_operands (body); + if (asmop == NULL_RTX) + return true; + + for (i = 0; i < ASM_OPERANDS_LABEL_LENGTH (asmop); i++) + if (GET_CODE (ASM_OPERANDS_LABEL (asmop, i)) != LABEL_REF) + return false; + + return true; +} + /* Check that X is an insn-body for an `asm' with operands and that the operands mentioned in it are legitimate. */ @@ -129,6 +148,9 @@ check_asm_operands (rtx x) const char **constraints; int i; + if (!asm_labels_ok (x)) + return 0; + /* Post-reload, be more strict with things. */ if (reload_completed) {