re PR tree-optimization/77860 (ICE in gimple_build_assign_1, at gimple.c:420)
authorJakub Jelinek <jakub@redhat.com>
Mon, 31 Oct 2016 16:36:53 +0000 (17:36 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 31 Oct 2016 16:36:53 +0000 (17:36 +0100)
PR tree-optimization/77860
* tree-ssa-reassoc.c (eliminate_using_constants): Handle
also integral complex and vector constants.

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

From-SVN: r241706

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr77860.c [new file with mode: 0644]
gcc/tree-ssa-reassoc.c

index d462d73..d596b17 100644 (file)
@@ -1,5 +1,9 @@
 2016-10-31  Jakub Jelinek  <jakub@redhat.com>
 
+       PR tree-optimization/77860
+       * tree-ssa-reassoc.c (eliminate_using_constants): Handle
+       also integral complex and vector constants.
+
        * dwarf2out.c (dwarf2out_define, dwarf2out_undef, output_macinfo_op,
        optimize_macinfo_range, save_macinfo_strings): Replace
        DW_MACRO_GNU_* constants with corresponding DW_MACRO_* constants.
index 63b2a47..037096c 100644 (file)
@@ -1,3 +1,8 @@
+2016-10-31  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/77860
+       * gcc.dg/pr77860.c: New test.
+
 2016-10-31  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>
 
        * gcc.dg/lto/pr60449_0.c: Skip for avr.
@@ -12,7 +17,6 @@
        * g++.dg/warn/Wshadow-local-1.C: Likewise.
        * g++.dg/warn/Wshadow-local-2.C: Likewise.
 
-
 2016-10-30  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
 
        PR tree-optimization/71915
diff --git a/gcc/testsuite/gcc.dg/pr77860.c b/gcc/testsuite/gcc.dg/pr77860.c
new file mode 100644 (file)
index 0000000..04346b1
--- /dev/null
@@ -0,0 +1,13 @@
+/* PR tree-optimization/77860 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-vrp -fno-tree-forwprop -Wno-psabi" } */
+
+typedef unsigned short V __attribute__((vector_size (16)));
+
+V
+foo (V x, V y)
+{
+  V a = -x;
+  V b = -y;
+  return a * b;
+}
index 99e1b41..5dcf672 100644 (file)
@@ -924,7 +924,7 @@ eliminate_using_constants (enum tree_code opcode,
   tree type = TREE_TYPE (oelast->op);
 
   if (oelast->rank == 0
-      && (INTEGRAL_TYPE_P (type) || FLOAT_TYPE_P (type)))
+      && (ANY_INTEGRAL_TYPE_P (type) || FLOAT_TYPE_P (type)))
     {
       switch (opcode)
        {