re PR middle-end/85195 (ICE: verify_gimple failed: non-trivial conversion at assignme...
authorJakub Jelinek <jakub@redhat.com>
Thu, 5 Apr 2018 18:35:16 +0000 (20:35 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 5 Apr 2018 18:35:16 +0000 (20:35 +0200)
PR middle-end/85195
* match.pd (BIT_FIELD_REF CONSTRUCTOR@0 @1 @2): Use view_convert around
CONSTRUCTOR_ELT (ctor, ...)->value.

* gcc.dg/pr85195.c: New test.

From-SVN: r259149

gcc/ChangeLog
gcc/match.pd
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr85195.c [new file with mode: 0644]

index be9c255a4b6c643756ee1909f525cb980fa163b8..c9c538b716bf5850292269af0fda7f0f171de1f7 100644 (file)
@@ -1,3 +1,9 @@
+2018-04-05  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/85195
+       * match.pd (BIT_FIELD_REF CONSTRUCTOR@0 @1 @2): Use view_convert around
+       CONSTRUCTOR_ELT (ctor, ...)->value.
+
 2018-04-05  Uros Bizjak  <ubizjak@gmail.com>
 
        PR target/85193
index 7c4c11c4ef7dedc97e1be859700ddf5825a2fb86..02753c0f85ce4c606e94d53f609602906888ad5d 100644 (file)
@@ -4650,7 +4650,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
         { build_constructor (type, NULL); }
        (if (count == 1)
         (if (elt < CONSTRUCTOR_NELTS (ctor))
-         { CONSTRUCTOR_ELT (ctor, elt)->value; }
+         (view_convert { CONSTRUCTOR_ELT (ctor, elt)->value; })
          { build_zero_cst (type); })
         {
           vec<constructor_elt, va_gc> *vals;
@@ -4668,7 +4668,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
        (if (CONSTRUCTOR_NELTS (ctor) <= idx / const_k)
         { build_zero_cst (type); })
        (if (n == const_k)
-        { CONSTRUCTOR_ELT (ctor, idx / const_k)->value; })
+        (view_convert { CONSTRUCTOR_ELT (ctor, idx / const_k)->value; }))
        (BIT_FIELD_REF { CONSTRUCTOR_ELT (ctor, idx / const_k)->value; }
                       @1 { bitsize_int ((idx % const_k) * width); })))))))))
 
index 1acfe0c89ea84b6494ea3492473043924baa5745..d6a9738a1777fe984ec665c12a336da737c65aa9 100644 (file)
@@ -1,3 +1,8 @@
+2018-04-05  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/85195
+       * gcc.dg/pr85195.c: New test.
+
 2018-04-05  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/80956
diff --git a/gcc/testsuite/gcc.dg/pr85195.c b/gcc/testsuite/gcc.dg/pr85195.c
new file mode 100644 (file)
index 0000000..0cc696b
--- /dev/null
@@ -0,0 +1,19 @@
+/* PR middle-end/85195 */
+/* { dg-do compile { target int128 } } */
+/* { dg-options "-Wno-psabi -O -fno-tree-ccp --param=sccvn-max-scc-size=10" } */
+
+typedef __int128 V __attribute__ ((vector_size (16)));
+
+extern int bar (V);
+
+V v;
+int i;
+
+V
+foo (void)
+{
+  do
+    v *= bar (v & i);
+  while ((V){}[0]);
+  return v;
+}