]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/66233 (internal compiler error: in expand_fix, at optabs...
authorJakub Jelinek <jakub@redhat.com>
Thu, 18 Jun 2015 14:03:50 +0000 (16:03 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 18 Jun 2015 14:03:50 +0000 (16:03 +0200)
PR tree-optimization/66233
* fold-const.c (fold_unary_loc): Don't handle vector types.
Simplify.
* tree-ssa-forwprop.c (combine_conversions): Likewise.

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

From-SVN: r224609

gcc/ChangeLog
gcc/fold-const.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/pr66233.c [new file with mode: 0644]
gcc/tree-ssa-forwprop.c

index 8e158d701ac1898aeba6f9d2c1acfb3bf540879e..7684a354f6df159189e077b566e50ab91d957fda 100644 (file)
@@ -1,3 +1,10 @@
+2015-06-18  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/66233
+       * fold-const.c (fold_unary_loc): Don't handle vector types.
+       Simplify.
+       * tree-ssa-forwprop.c (combine_conversions): Likewise.
+
 2015-06-16  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>
 
        PR target/66200
index 82b68bf3a9d623aac907014869c56e10bbcc03c1..8e32c7222b569bd43fcaacd21e461cfbb5c8f02f 100644 (file)
@@ -8011,16 +8011,12 @@ fold_unary_loc (location_t loc, enum tree_code code, tree type, tree op0)
             (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)
+             && (inter_float || inter_unsignedp == inside_unsignedp)
              && ! (final_prec != GET_MODE_PRECISION (TYPE_MODE (type))
-                   && TYPE_MODE (type) == TYPE_MODE (inter_type))
-             && ! final_ptr
-             && (! final_vec || inter_prec == inside_prec))
+                   && TYPE_MODE (type) == TYPE_MODE (inter_type)))
            return fold_build1_loc (loc, code, type, TREE_OPERAND (op0, 0));
 
          /* If we have a sign-extension of a zero-extended value, we can
index d97bdee5f39db611a19826ed9c6240fb1ae8ff06..dd0298391f41c20e0562c78f0da68bdb02835ca5 100644 (file)
@@ -1,3 +1,8 @@
+2015-06-18  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/66233
+       * gcc.c-torture/execute/pr66233.c: New test.
+
 2015-06-16  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>
 
        PR target/66200
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;
+}
index 99c3d0f3eb990270560e9006d8aec6b6f0578ed1..109b44f3f9cad6b61e416a7979404b571d8ca872 100644 (file)
@@ -3036,16 +3036,12 @@ combine_conversions (gimple_stmt_iterator *gsi)
         (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)
+         && (inter_float || inter_unsignedp == inside_unsignedp)
          && ! (final_prec != GET_MODE_PRECISION (TYPE_MODE (type))
-               && TYPE_MODE (type) == TYPE_MODE (inter_type))
-         && ! final_ptr
-         && (! final_vec || inter_prec == inside_prec))
+               && TYPE_MODE (type) == TYPE_MODE (inter_type)))
        {
          gimple_assign_set_rhs1 (stmt, defop0);
          update_stmt (stmt);