]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/57377 (compiler cannot be built with RTL checking)
authorAndreas Krebbel <Andreas.Krebbel@de.ibm.com>
Thu, 10 Oct 2013 12:01:23 +0000 (12:01 +0000)
committerAndreas Krebbel <krebbel@gcc.gnu.org>
Thu, 10 Oct 2013 12:01:23 +0000 (12:01 +0000)
2013-10-10  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

PR target/57377
* gensupport.c (gen_mnemonic_attr): Handle (set (attr x) y) and
(set_attr_alternative x ...) when searching for user defined
mnemonic attribute.

From-SVN: r203353

gcc/ChangeLog
gcc/gensupport.c

index cae8b0b4b8f1574404ee97aee70b75189e75a28a..fdf0f2cc1d3c41862f9656d0c3eb834e90b80b08 100644 (file)
@@ -1,3 +1,10 @@
+2013-10-10  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
+
+       PR target/57377
+       * gensupport.c (gen_mnemonic_attr): Handle (set (attr x) y) and
+       (set_attr_alternative x ...) when searching for user defined
+       mnemonic attribute.
+
 2013-10-10  Andrew MacLeod  <amacleod@redhat.com>
 
        * config/aplha/alpha.c: Add gimple-ssa.h to include list.
index 28165e371379176ebef1de3b33ebd3241912c908..e6c5c23a161c426a7635a4b7dbffb3dffea9e960 100644 (file)
@@ -2445,14 +2445,29 @@ gen_mnemonic_attr (void)
       bool found = false;
 
       /* Check if the insn definition already has
-        (set_attr "mnemonic" ...).  */
+        (set_attr "mnemonic" ...) or (set (attr "mnemonic") ...).  */
       if (XVEC (insn, 4))
        for (i = 0; i < XVECLEN (insn, 4); i++)
-         if (strcmp (XSTR (XVECEXP (insn, 4, i), 0), MNEMONIC_ATTR_NAME) == 0)
-           {
-             found = true;
-             break;
-           }
+         {
+           rtx set_attr = XVECEXP (insn, 4, i);
+
+           switch (GET_CODE (set_attr))
+             {
+             case SET_ATTR:
+             case SET_ATTR_ALTERNATIVE:
+               if (strcmp (XSTR (set_attr, 0), MNEMONIC_ATTR_NAME) == 0)
+                 found = true;
+               break;
+             case SET:
+               if (GET_CODE (SET_DEST (set_attr)) == ATTR
+                   && strcmp (XSTR (SET_DEST (set_attr), 0),
+                              MNEMONIC_ATTR_NAME) == 0)
+                 found = true;
+               break;
+             default:
+               break;
+             }
+         }
 
       if (!found)
        gen_mnemonic_setattr (mnemonic_htab, insn);