if (icode == CODE_FOR_nothing)
{
if (tcode == LT_EXPR
- && op0a == op0
- && TREE_CODE (op0) == VECTOR_CST)
+ && op0a == op0)
{
/* A VEC_COND_EXPR condition could be folded from EQ_EXPR/NE_EXPR
into a constant when only get_vcond_eq_icode is supported.
- Verify < 0 and != 0 behave the same and change it to NE_EXPR. */
- unsigned HOST_WIDE_INT nelts;
- if (!VECTOR_CST_NELTS (op0).is_constant (&nelts))
- {
- if (VECTOR_CST_STEPPED_P (op0))
- gcc_unreachable ();
- nelts = vector_cst_encoded_nelts (op0);
- }
- for (unsigned int i = 0; i < nelts; ++i)
- if (tree_int_cst_sgn (vector_cst_elt (op0, i)) == 1)
- gcc_unreachable ();
+ Try changing it to NE_EXPR. */
tcode = NE_EXPR;
}
if (tcode == EQ_EXPR || tcode == NE_EXPR)
--- /dev/null
+/* { dg-do compile } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-Og -fno-early-inlining -fno-tree-ccp -fno-tree-dce" } */
+/* { dg-additional-options "-mavx -mno-sse4.2" { target x86_64-*-* i?86-*-* } } */
+
+typedef int __attribute__ ((__vector_size__ (16))) U;
+typedef unsigned long __attribute__ ((__vector_size__ (16))) V;
+
+static inline int
+bar (unsigned long e, V f)
+{
+ V g = f != e;
+ (union {U b;}){(U) g};
+}
+
+void
+foo (void)
+{
+ int j = bar (8, (V) { });
+ for (unsigned i;; i[&j])
+ ;
+}