From 1d2fdec6bc1fe203e9df6f5e5edf69f50af0b35d Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Mon, 3 Aug 2015 13:20:22 +0000 Subject: [PATCH] genmatch.c (dt_simplify::gen): Create captures array with an initializer. 2015-08-03 Richard Biener * genmatch.c (dt_simplify::gen): Create captures array with an initializer. From-SVN: r226503 --- gcc/ChangeLog | 5 +++++ gcc/genmatch.c | 17 ++++++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 42b03ce9d18..84084caf1e6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-08-03 Richard Biener + + * genmatch.c (dt_simplify::gen): Create captures array + with an initializer. + 2015-08-03 Ulrich Weigand * configure.ac: Set aliasing_flags to -fno-strict-aliasing if diff --git a/gcc/genmatch.c b/gcc/genmatch.c index a1bc410c39b..f854794c635 100644 --- a/gcc/genmatch.c +++ b/gcc/genmatch.c @@ -3023,16 +3023,15 @@ dt_simplify::gen (FILE *f, int indent, bool gimple) output_line_directive (f, s->result ? s->result->location : s->match->location); if (s->capture_max >= 0) - fprintf_indent (f, indent, "tree captures[%u] ATTRIBUTE_UNUSED = {};\n", - s->capture_max + 1); + { + char opname[20]; + fprintf_indent (f, indent, "tree captures[%u] ATTRIBUTE_UNUSED = { %s", + s->capture_max + 1, indexes[0]->get_name (opname)); - for (int i = 0; i <= s->capture_max; ++i) - if (indexes[i]) - { - char opname[20]; - fprintf_indent (f, indent, "captures[%u] = %s;\n", - i, indexes[i]->get_name (opname)); - } + for (int i = 1; i <= s->capture_max; ++i) + fprintf (f, ", %s", indexes[i]->get_name (opname)); + fprintf (f, " };\n"); + } /* If we have a split-out function for the actual transform, call it. */ if (info && info->fname) -- 2.30.2