re PR tree-optimization/66233 (internal compiler error: in expand_fix, at optabs...
authorJakub Jelinek <jakub@redhat.com>
Thu, 21 May 2015 19:17:28 +0000 (21:17 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 21 May 2015 19:17:28 +0000 (21:17 +0200)
PR tree-optimization/66233
* match.pd (ocvt (icvt@1 @0)): Don't handle vector types.
Simplify.

* gcc.c-torture/execute/pr66233.c: New test.

From-SVN: r223500

gcc/ChangeLog
gcc/match.pd
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/pr66233.c [new file with mode: 0644]

index 48472bc..a74a7ad 100644 (file)
@@ -1,3 +1,9 @@
+2015-05-21  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/66233
+       * match.pd (ocvt (icvt@1 @0)): Don't handle vector types.
+       Simplify.
+
 2015-05-21  Jeff Law  <law@redhat.com>
 
        * config/pa/pa.md (add-with-constant splitter): Use ASHIFT rather
index ce62853..73ccfbd 100644 (file)
@@ -730,16 +730,12 @@ along with GCC; see the file COPYING3.  If not see
       (for integers).  Avoid this if the final type is a pointer since
       then we sometimes need the middle conversion.  Likewise if the
       final type has a precision not equal to the size of its mode.  */
-   (if (((inter_int && inside_int)
-        || (inter_float && inside_float)
-        || (inter_vec && inside_vec))
+   (if (((inter_int && inside_int) || (inter_float && inside_float))
+       && (final_int || final_float)
        && inter_prec >= inside_prec
-       && (inter_float || inter_vec
-           || inter_unsignedp == inside_unsignedp)
-       && ! (final_prec != GET_MODE_PRECISION (element_mode (type))
-             && element_mode (type) == element_mode (inter_type))
-       && ! final_ptr
-       && (! final_vec || inter_prec == inside_prec))
+       && (inter_float || inter_unsignedp == inside_unsignedp)
+       && ! (final_prec != GET_MODE_PRECISION (TYPE_MODE (type))
+             && TYPE_MODE (type) == TYPE_MODE (inter_type)))
     (ocvt @0))
 
    /* If we have a sign-extension of a zero-extended value, we can
index 73a3e56..e5083f6 100644 (file)
@@ -1,3 +1,8 @@
+2015-05-21  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/66233
+       * gcc.c-torture/execute/pr66233.c: New test.
+
 2015-05-21  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
        PR fortran/66176
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr66233.c b/gcc/testsuite/gcc.c-torture/execute/pr66233.c
new file mode 100644 (file)
index 0000000..b0d63b6
--- /dev/null
@@ -0,0 +1,22 @@
+/* PR tree-optimization/66233 */
+
+unsigned int v[8];
+
+__attribute__((noinline, noclone)) void
+foo (void)
+{
+  int i;
+  for (i = 0; i < 8; i++)
+    v[i] = (float) i;
+}
+
+int
+main ()
+{
+  unsigned int i;
+  foo ();
+  for (i = 0; i < 8; i++)
+    if (v[i] != i)
+      __builtin_abort ();
+  return 0;
+}