]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/57980 (gcc 4.8.1 -foptimize-sibling-calls -O1 ICE in build_in...
authorMarek Polacek <polacek@redhat.com>
Tue, 13 Aug 2013 13:42:28 +0000 (13:42 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Tue, 13 Aug 2013 13:42:28 +0000 (13:42 +0000)
2013-08-13  Marek Polacek  <polacek@redhat.com>
    Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/57980
* tree-tailcall.c (process_assignment): Return false
when not dealing with integers or floats.

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

From-SVN: r201688

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr57980.c [new file with mode: 0644]
gcc/tree-tailcall.c

index b81c9d69ee044a8c53878973c36378853e612541..0479d726df5df712365761f6da2c56d968776d2c 100644 (file)
@@ -1,3 +1,13 @@
+2013-08-13  Marek Polacek  <polacek@redhat.com>
+
+       Backport from 4.8:
+       2013-0813  Marek Polacek  <polacek@redhat.com>
+                  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/57980
+       * tree-tailcall.c (process_assignment): Return false
+       when not dealing with integers or floats.
+
 2013-08-12  David Edelsohn  <dje.gcc@gmail.com>
 
        Backport from mainline
index 302cc20c9e1dcf550a7d3af881f5cae7b7236051..39178c08a28facd8b4f29817b46d2251564704d7 100644 (file)
@@ -1,3 +1,11 @@
+2013-08-13  Marek Polacek  <polacek@redhat.com>
+
+       Backport from 4.8:
+       2013-08-13  Marek Polacek  <polacek@redhat.com>
+
+       PR tree-optimization/57980
+       * gcc.dg/pr57980.c: New test.
+
 2013-08-11  Janus Weil  <janus@gcc.gnu.org>
 
        Backport from trunk:
diff --git a/gcc/testsuite/gcc.dg/pr57980.c b/gcc/testsuite/gcc.dg/pr57980.c
new file mode 100644 (file)
index 0000000..be83536
--- /dev/null
@@ -0,0 +1,19 @@
+/* PR tree-optimization/57980 */
+/* { dg-do compile } */
+/* { dg-options "-O -foptimize-sibling-calls -w" } */
+
+typedef int V __attribute__ ((vector_size (2 * sizeof (int))));
+extern V f (void);
+
+V
+bar (void)
+{
+  return -f ();
+}
+
+V
+foo (void)
+{
+  V v = { };
+  return v - f ();
+}
index 66fb89252c4756db09117b57eb513ef7aab380a8..f07297e86c9c9d810d6091ff28a6059132f60963 100644 (file)
@@ -329,8 +329,10 @@ process_assignment (gimple stmt, gimple_stmt_iterator call, tree *m,
     case NEGATE_EXPR:
       if (FLOAT_TYPE_P (TREE_TYPE (op0)))
         *m = build_real (TREE_TYPE (op0), dconstm1);
-      else
+      else if (INTEGRAL_TYPE_P (TREE_TYPE (op0)))
         *m = build_int_cst (TREE_TYPE (op0), -1);
+      else
+        return false;
 
       *ass_var = dest;
       return true;
@@ -342,8 +344,10 @@ process_assignment (gimple stmt, gimple_stmt_iterator call, tree *m,
         {
           if (FLOAT_TYPE_P (TREE_TYPE (non_ass_var)))
             *m = build_real (TREE_TYPE (non_ass_var), dconstm1);
-          else
+          else if (INTEGRAL_TYPE_P (TREE_TYPE (non_ass_var)))
             *m = build_int_cst (TREE_TYPE (non_ass_var), -1);
+         else
+           return false;
 
           *a = fold_build1 (NEGATE_EXPR, TREE_TYPE (non_ass_var), non_ass_var);
         }