From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 48385 invoked by alias); 9 Apr 2015 06:58:04 -0000 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 Received: (qmail 48373 invoked by uid 89); 9 Apr 2015 06:58:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 09 Apr 2015 06:58:03 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t396w02v030261 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 9 Apr 2015 02:58:00 -0400 Received: from tucnak.zalov.cz (ovpn-116-58.ams2.redhat.com [10.36.116.58]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t396vvGE004642 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 9 Apr 2015 02:57:59 -0400 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.14.9/8.14.9) with ESMTP id t396vtCl018218; Thu, 9 Apr 2015 08:57:55 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.14.9/8.14.9/Submit) id t396vq33018217; Thu, 9 Apr 2015 08:57:52 +0200 Date: Thu, 09 Apr 2015 06:58:00 -0000 From: Jakub Jelinek To: Segher Boessenkool Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Be less conservative in process_{output,input}_constraints (PR target/65689) Message-ID: <20150409065752.GB19273@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <20150408210059.GZ19273@tucnak.redhat.com> <20150408221207.GB26923@gate.crashing.org> <20150408221608.GC26923@gate.crashing.org> <20150408222040.GA19273@tucnak.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150408222040.GA19273@tucnak.redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2015-04/txt/msg00366.txt.bz2 On Thu, Apr 09, 2015 at 12:20:40AM +0200, Jakub Jelinek wrote: > On Wed, Apr 08, 2015 at 05:16:08PM -0500, Segher Boessenkool wrote: > > On Wed, Apr 08, 2015 at 05:12:07PM -0500, Segher Boessenkool wrote: > > > On Wed, Apr 08, 2015 at 11:00:59PM +0200, Jakub Jelinek wrote: > > > > + case MATCH_CODE: > > > > + if (*XSTR (exp, 1) == '\0') > > > > + { > > > > + const char *code, *codes = XSTR (exp, 0); > > > > + int ret = 0; > > > > + while ((code = scan_comma_elt (&codes)) != 0) > > > > + if (strncmp (code, "reg", 3) == 0 > > > > + && (code[3] == ',' || code[3] == '\0' || code[3] == ' ')) > > > > > > This doesn't allow other whitespace. Maybe it's cleaner written as e.g. > > > > > > && codes - code == 3 > > > > ... and that doesn't handle trailing whitespace. Ugh. > > Yeah. Guess I should use > && (code[3] == ',' || code[3] == '\0' || ISSPACE (code[3])) > instead then. Or another option is just to follow what genpreds.c uses earlier: || (!strstr (XSTR (exp, 0), "const_int") && !strstr (XSTR (exp, 0), "const_double"))) if (strstr (XSTR (exp, 0), "reg")) ret |= 1; if (strstr (XSTR (exp, 0), "mem")) ret |= 2; would match besides reg/subreg or mem also define_register_constraint or define_memory_constraint, but those surely won't appear in sane constraints.md (and even if they would, all we need is conservative test). Jakub