aboutsummaryrefslogtreecommitdiff
path: root/gcc/genmatch.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2016-10-18 07:25:40 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2016-10-18 07:25:40 +0000
commit699acd5b64b6dd9908f968d4fac14c61ae038afc (patch)
tree6e93a8a936cd71e26bce17e5463f1cfc4ec9cc17 /gcc/genmatch.c
parentc680ada5f527a33ea7c793704019fb46c795d5f4 (diff)
downloadgcc-699acd5b64b6dd9908f968d4fac14c61ae038afc.zip
gcc-699acd5b64b6dd9908f968d4fac14c61ae038afc.tar.gz
gcc-699acd5b64b6dd9908f968d4fac14c61ae038afc.tar.bz2
genmatch.c (dt_operand::gen_gimple_expr): Use get_name to get at the operand to look at with TREE_OPERAND for generic...
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
Diffstat (limited to 'gcc/genmatch.c')
-rw-r--r--gcc/genmatch.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/gcc/genmatch.c b/gcc/genmatch.c
index fc4f598..b14034d 100644
--- a/gcc/genmatch.c
+++ b/gcc/genmatch.c
@@ -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);