From patchwork Tue Aug 25 09:39:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Collison X-Patchwork-Id: 52668 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by patches.linaro.org (Postfix) with ESMTPS id C19E822E9E for ; Tue, 25 Aug 2015 09:46:52 +0000 (UTC) Received: by wicul11 with SMTP id ul11sf3811301wic.1 for ; Tue, 25 Aug 2015 02:46:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mailing-list:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:sender :delivered-to:message-id:date:from:user-agent:mime-version:to :subject:content-type:content-transfer-encoding:x-original-sender :x-original-authentication-results; bh=KTTYFy3ow8fueXE8DPVDmJLIP3/jzOZ3Ml2fQjFhoto=; b=SLZtcFPtVpDY4iJU+fMqejAKq2L3yKVwQH2SoiIoeVPKE+abMW1nL33Q+1C5zqgI2N vompLU9JOZxxRpEimRhs9jtrh8/LObaR2AsCj21Vib1UZWDAwCjeyFCSA2QVwhiGYCAu iDnT3dqExsHHiWp+BYxLuX2AYYKD5GeNbXV38YDholWmDLSCOhcN+Bi18Zj3U7ZkFBka f/1PBv8k5dG3O8vDC74ho0aBIUOszLvzf4O3AOOlKykjoHVJIDIFJexpXqapf9ww484H br/wOYtWV5knk6y4d8hM8nG9VtPUuorfgAECXhJiFHcPGRRxhi3jKKsL2VHo3AXeFAsJ cFZQ== X-Gm-Message-State: ALoCoQmerkZ79q38vFAlCs/EOF5R/ptCsHi5h75Sd4LihTcc7BzQxsiLXxVBu6AsCot9FG23fEkx X-Received: by 10.112.148.101 with SMTP id tr5mr8220199lbb.13.1440496012097; Tue, 25 Aug 2015 02:46:52 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.170 with SMTP id x10ls221748lal.61.gmail; Tue, 25 Aug 2015 02:46:51 -0700 (PDT) X-Received: by 10.112.162.2 with SMTP id xw2mr24427721lbb.98.1440496011948; Tue, 25 Aug 2015 02:46:51 -0700 (PDT) Received: from mail-lb0-x232.google.com (mail-lb0-x232.google.com. [2a00:1450:4010:c04::232]) by mx.google.com with ESMTPS id k1si15584200lbc.156.2015.08.25.02.46.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Aug 2015 02:46:51 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::232 as permitted sender) client-ip=2a00:1450:4010:c04::232; Received: by lbbtg9 with SMTP id tg9so96610762lbb.1 for ; Tue, 25 Aug 2015 02:46:51 -0700 (PDT) X-Received: by 10.112.166.106 with SMTP id zf10mr24827218lbb.36.1440496011859; Tue, 25 Aug 2015 02:46:51 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.162.200 with SMTP id yc8csp3047759lbb; Tue, 25 Aug 2015 02:46:50 -0700 (PDT) X-Received: by 10.68.218.65 with SMTP id pe1mr54044750pbc.2.1440496009782; Tue, 25 Aug 2015 02:46:49 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id tn4si32143042pbc.45.2015.08.25.02.46.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Aug 2015 02:46:49 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-405939-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 115028 invoked by alias); 25 Aug 2015 09:46:37 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list 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 Received: (qmail 115011 invoked by uid 89); 25 Aug 2015 09:46:36 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL, BAYES_40, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pd0-f169.google.com Received: from mail-pd0-f169.google.com (HELO mail-pd0-f169.google.com) (209.85.192.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 25 Aug 2015 09:46:34 +0000 Received: by pdbfa8 with SMTP id fa8so64987741pdb.1 for ; Tue, 25 Aug 2015 02:46:32 -0700 (PDT) X-Received: by 10.70.102.34 with SMTP id fl2mr55197911pdb.56.1440495580552; Tue, 25 Aug 2015 02:39:40 -0700 (PDT) Received: from [192.168.1.14] ([70.176.202.128]) by smtp.googlemail.com with ESMTPSA id v2sm20347759pda.34.2015.08.25.02.39.39 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Aug 2015 02:39:39 -0700 (PDT) Message-ID: <55DC37D4.9050900@linaro.org> Date: Tue, 25 Aug 2015 02:39:32 -0700 From: Michael Collison User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: gcc Patches Subject: [PATCH, PR 57195] Allow mode iterators inside angle brackets X-Original-Sender: michael.collison@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::232 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@gcc.gnu.org X-Google-Group-Id: 836684582541 This patch allow mode iterators inside angle brackets in machine description files. I discovered the issue when attempting to use iterators on match_operand's as follows: match_operand: 0 "s_register_operand" "=w") The function 'read_name' is nor properly handling ':' inside angle brackets. Bootstrapped on arm-linux. OK for trunk? 2015-08-25 Michael Collison PR other/57195 * read-md.c (read_name): Allow mode iterators inside angle brackets in rtl expressions. diff --git a/gcc/read-md.c b/gcc/read-md.c index 9f158ec..0171fb0 100644 --- a/gcc/read-md.c +++ b/gcc/read-md.c @@ -399,17 +399,25 @@ read_name (struct md_name *name) { int c; size_t i; + bool in_angle_bracket; c = read_skip_spaces (); i = 0; + in_angle_bracket = false; while (1) { + if (c == '<') + in_angle_bracket = true; + + if (c == '>') + in_angle_bracket = false; + if (c == ' ' || c == '\n' || c == '\t' || c == '\f' || c == '\r' || c == EOF) break; - if (c == ':' || c == ')' || c == ']' || c == '"' || c == '/' - || c == '(' || c == '[') + if (((c == ':') and (!in_angle_bracket)) || c == ')' || c == ']' + || c == '"' || c == '/' || c == '(' || c == '[') { unread_char (c); break;