2015-06-08 Marc Glisse <marc.glisse@inria.fr>
authorglisse <glisse@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 8 Jun 2015 12:20:43 +0000 (12:20 +0000)
committerglisse <glisse@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 8 Jun 2015 12:20:43 +0000 (12:20 +0000)
* genmatch.c (expr::gen_transform): For conditions, guess the type
from the second operand.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@224220 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/genmatch.c

index e33780f..e7616d3 100644 (file)
@@ -1,3 +1,8 @@
+2015-06-08  Marc Glisse  <marc.glisse@inria.fr>
+
+       * genmatch.c (expr::gen_transform): For conditions, guess the type
+       from the second operand.
+
 2015-06-08  Tom de Vries  <tom@codesourcery.com>
 
        PR tree-optimization/66442
index 9dc3b8c..f271703 100644 (file)
@@ -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.  */