+2012-06-26  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/53748
+       * tree-ssa-phiopt.c (conditional_replacement): Only optimize
+       if arg0/arg1 have integral or pointer types.
+
 2012-06-25  Richard Henderson  <rth@redhat.com>
 
        * config/i386/sse.md (sse2_sse4_1): Remove code attr.
 
+2012-06-26  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/53748
+       * gcc.c-torture/compile/pr53748.c: New test.
+
 2012-06-25  Jason Merrill  <jason@redhat.com>
 
        PR c++/53498
 
--- /dev/null
+/* PR tree-optimization/53748 */
+
+typedef unsigned int V __attribute__ ((__vector_size__ (sizeof (int) * 4)));
+
+void
+foo (int x, V *y)
+{
+  *y = x ? ((V) { ~0U, ~0U, ~0U, ~0U }) : ((V) { 0, 0, 0, 0 });
+}
 
   bool neg;
 
   /* FIXME: Gimplification of complex type is too hard for now.  */
-  if (TREE_CODE (TREE_TYPE (arg0)) == COMPLEX_TYPE
-      || TREE_CODE (TREE_TYPE (arg1)) == COMPLEX_TYPE)
+  /* We aren't prepared to handle vectors either (and it is a question
+     if it would be worthwhile anyway).  */
+  if (!(INTEGRAL_TYPE_P (TREE_TYPE (arg0))
+       || POINTER_TYPE_P (TREE_TYPE (arg0)))
+      || !(INTEGRAL_TYPE_P (TREE_TYPE (arg1))
+          || POINTER_TYPE_P (TREE_TYPE (arg1))))
     return false;
 
   /* The PHI arguments have the constants 0 and 1, or 0 and -1, then