public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Michael Collison <michael.collison@linaro.org>
To: gcc Patches <gcc-patches@gcc.gnu.org>
Subject: [PATCH, PR 57195] Allow mode iterators inside angle brackets
Date: Tue, 25 Aug 2015 09:48:00 -0000	[thread overview]
Message-ID: <55DC37D4.9050900@linaro.org> (raw)

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:<VW:V_widen> 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  <michael.collison@linaro.org>

     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;

-- 
Michael Collison
Linaro Toolchain Working Group
michael.collison@linaro.org

             reply	other threads:[~2015-08-25  9:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-25  9:48 Michael Collison [this message]
2015-09-07 10:07 ` Richard Sandiford
2015-09-10  0:58   ` Michael Collison
2015-09-14  9:36     ` Richard Sandiford
2015-09-17  0:00       ` Michael Collison
2015-09-17 19:42         ` Richard Sandiford

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55DC37D4.9050900@linaro.org \
    --to=michael.collison@linaro.org \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).