From 7026b8dfd18fc18e7110c193b1a41d4bb119c8c7 Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Mon, 8 Jun 2015 14:20:43 +0200 Subject: [PATCH] genmatch.c (expr::gen_transform): For conditions, guess the type from the second operand. 2015-06-08 Marc Glisse * genmatch.c (expr::gen_transform): For conditions, guess the type from the second operand. From-SVN: r224220 --- gcc/ChangeLog | 5 +++++ gcc/genmatch.c | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e33780fe942..e7616d3226e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-06-08 Marc Glisse + + * genmatch.c (expr::gen_transform): For conditions, guess the type + from the second operand. + 2015-06-08 Tom de Vries PR tree-optimization/66442 diff --git a/gcc/genmatch.c b/gcc/genmatch.c index 9dc3b8cf952..f27170381d8 100644 --- a/gcc/genmatch.c +++ b/gcc/genmatch.c @@ -1709,6 +1709,13 @@ expr::gen_transform (FILE *f, const char *dest, bool gimple, int depth, sprintf (optype, "boolean_type_node"); type = optype; } + else if (*operation == COND_EXPR + || *operation == VEC_COND_EXPR) + { + /* Conditions are of the same type as their first alternative. */ + sprintf (optype, "TREE_TYPE (ops%d[1])", depth); + type = optype; + } else { /* Other operations are of the same type as their first operand. */ -- 2.30.2