genmatch.c (dt_operand::gen_gimple_expr): Use get_name to get at the operand to look...
authorRichard Biener <rguenther@suse.de>
Tue, 18 Oct 2016 07:25:40 +0000 (07:25 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 18 Oct 2016 07:25:40 +0000 (07:25 +0000)
2016-10-18  Richard Biener  <rguenther@suse.de>

* genmatch.c (dt_operand::gen_gimple_expr): Use get_name to
get at the operand to look at with TREE_OPERAND for generic
sub-nodes.

From-SVN: r241295

gcc/ChangeLog
gcc/genmatch.c

index 84e773046b5d76aa92d260ebab499dfc99eeef60..2c10faf83e4a9de72ab2aaf8706a851a6c169551 100644 (file)
@@ -1,3 +1,9 @@
+2016-10-18  Richard Biener  <rguenther@suse.de>
+
+       * genmatch.c (dt_operand::gen_gimple_expr): Use get_name to
+       get at the operand to look at with TREE_OPERAND for generic
+       sub-nodes.
+
 2016-10-18  David Malcolm  <dmalcolm@redhat.com>
 
        * genattrtab.c (attr_string): Use rtx_reader_ptr for call to
index fc4f5987fc44faf6f7d991d03b95c12fc1bab147..b14034deb7c53f4857ccc2b8dad697d9c92ed9c9 100644 (file)
@@ -2644,9 +2644,19 @@ dt_operand::gen_gimple_expr (FILE *f, int indent)
              /* ???  If this is a memory operation we can't (and should not)
                 match this.  The only sensible operand types are
                 SSA names and invariants.  */
-             fprintf_indent (f, indent,
-                             "tree %s = TREE_OPERAND (gimple_assign_rhs1 (def), %i);\n",
-                             child_opname, i);
+             if (e->is_generic)
+               {
+                 char opname[20];
+                 get_name (opname);
+                 fprintf_indent (f, indent,
+                                 "tree %s = TREE_OPERAND (%s, %i);\n",
+                                 child_opname, opname, i);
+               }
+             else
+               fprintf_indent (f, indent,
+                               "tree %s = TREE_OPERAND "
+                               "(gimple_assign_rhs1 (def), %i);\n",
+                               child_opname, i);
              fprintf_indent (f, indent,
                              "if ((TREE_CODE (%s) == SSA_NAME\n",
                              child_opname);