https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70916

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #2)
> For the ICE the fix is easy:
> --- tree-vect-patterns.c.jj1  2016-03-23 10:51:23.000000000 +0100
> +++ tree-vect-patterns.c      2016-05-03 08:39:17.779229143 +0200
> @@ -3673,8 +3673,10 @@ vect_recog_mask_conversion_pattern (vec<
>         if (!rhs1_type)
>           return NULL;
>       }
> -      else
> +      else if (COMPARISON_CLASS_P (rhs1))
>       rhs1_type = TREE_TYPE (TREE_OPERAND (rhs1, 0));
> +      else
> +     return NULL;
>  
>        vectype2 = get_mask_type_for_scalar_type (rhs1_type);
>  
> now to figure out why tree-if-conv.c actually emitted something = 1 ? op2 :
> op3;

I supoose its fold_build_cond_expr doesn't work reliably anymore for some
reason.

Ah, constant_or_ssa_name fails to handle invariant ADDR_EXPRs.

Index: gcc/tree-if-conv.c
===================================================================
--- gcc/tree-if-conv.c  (revision 235738)
+++ gcc/tree-if-conv.c  (working copy)
@@ -413,17 +413,9 @@ fold_or_predicates (location_t loc, tree
 static bool
 constant_or_ssa_name (tree n)
 {
-  switch (TREE_CODE (n))
-    {
-      case SSA_NAME:
-      case INTEGER_CST:
-      case REAL_CST:
-      case COMPLEX_CST:
-      case VECTOR_CST:
-       return true;
-      default:
-       return false;
-    }
+  if (TREE_CODE (n) == SSA_NAME
+      || is_gimple_min_invariant (n))
+    return true;
 }

 /* Returns either a COND_EXPR or the folded expression if the folded

Reply via email to