From d003cf5ef683191902c19cad6cd3d7ddf957dcde Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 3 Jan 2017 08:17:38 +0100 Subject: [PATCH] genmatch.c (dt_node::gen_kids_1): If generic_exprs include SSA_NAME and exprs_len || fns_len... * genmatch.c (dt_node::gen_kids_1): If generic_exprs include SSA_NAME and exprs_len || fns_len, emit the code for SSA_NAME next to the exprs and fns handling, rather than in a separate case SSA_NAME. From-SVN: r244012 --- gcc/ChangeLog | 6 ++++++ gcc/genmatch.c | 17 +++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 698277a1788..b38e59a5462 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-01-03 Jakub Jelinek + + * genmatch.c (dt_node::gen_kids_1): If generic_exprs include SSA_NAME + and exprs_len || fns_len, emit the code for SSA_NAME next to the exprs + and fns handling, rather than in a separate case SSA_NAME. + 2017-01-02 Jeff Law * config/darwin-driver.c (darwin_driver_init): Const-correctness diff --git a/gcc/genmatch.c b/gcc/genmatch.c index 86f40b23225..c163ded6876 100644 --- a/gcc/genmatch.c +++ b/gcc/genmatch.c @@ -2913,6 +2913,20 @@ dt_node::gen_kids_1 (FILE *f, int indent, bool gimple, indent -= 6; fprintf_indent (f, indent, " }\n"); + /* See if there is SSA_NAME among generic_exprs and if yes, emit it + here rather than in the next loop. */ + for (unsigned i = 0; i < generic_exprs.length (); ++i) + { + expr *e = as_a (generic_exprs[i]->op); + id_base *op = e->operation; + if (*op == SSA_NAME && (exprs_len || fns_len)) + { + fprintf_indent (f, indent + 4, "{\n"); + generic_exprs[i]->gen (f, indent + 6, gimple); + fprintf_indent (f, indent + 4, "}\n"); + } + } + fprintf_indent (f, indent, " break;\n"); } @@ -2922,6 +2936,9 @@ dt_node::gen_kids_1 (FILE *f, int indent, bool gimple, id_base *op = e->operation; if (*op == CONVERT_EXPR || *op == NOP_EXPR) fprintf_indent (f, indent, "CASE_CONVERT:\n"); + else if (*op == SSA_NAME && (exprs_len || fns_len)) + /* Already handled above. */ + continue; else fprintf_indent (f, indent, "case %s:\n", op->id); fprintf_indent (f, indent, " {\n"); -- 2.30.2