From: Richard Biener Date: Tue, 18 Oct 2016 07:25:40 +0000 (+0000) Subject: genmatch.c (dt_operand::gen_gimple_expr): Use get_name to get at the operand to look... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=699acd5b64b6dd9908f968d4fac14c61ae038afc;p=gcc.git 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 * 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 84e773046b5..2c10faf83e4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-10-18 Richard Biener + + * 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 * genattrtab.c (attr_string): Use rtx_reader_ptr for call to diff --git a/gcc/genmatch.c b/gcc/genmatch.c index fc4f5987fc4..b14034deb7c 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);