On Wed, 23 Mar 2016, Richard Biener wrote:

I am testing the following obvious patch to fix an ICE in reassoc.

Bootstrap / regtest on x86_64-unknown-linux-gnu running.

Richard.

2016-03-23  Richard Biener  <rguent...@suse.de>

        PR tree-optimization/70372
        * tree-ssa-reassoc.c (eliminate_plus_minus_pair): Use
        build_minus_one_cst to also handle vector types correctly.

Are complex numbers also handled in reassoc? If so, build_all_ones_cst seems better. I never know if integer complex are supported...

        * gcc.dg/tree-ssa/pr70372.c: New testcase.

Index: gcc/tree-ssa-reassoc.c
===================================================================
*** gcc/tree-ssa-reassoc.c      (revision 234415)
--- gcc/tree-ssa-reassoc.c      (working copy)
*************** eliminate_plus_minus_pair (enum tree_cod
*** 821,827 ****
            }

          ops->ordered_remove (i);
!         add_to_ops_vec (ops, build_int_cst_type (op_type, -1));
          ops->ordered_remove (currindex);
          reassociate_stats.ops_eliminated ++;

--- 821,827 ----
            }

          ops->ordered_remove (i);
!         add_to_ops_vec (ops, build_minus_one_cst (op_type));
          ops->ordered_remove (currindex);
          reassociate_stats.ops_eliminated ++;

Index: gcc/testsuite/gcc.dg/tree-ssa/pr70372.c
===================================================================
*** gcc/testsuite/gcc.dg/tree-ssa/pr70372.c     (revision 0)
--- gcc/testsuite/gcc.dg/tree-ssa/pr70372.c     (working copy)
***************
*** 0 ****
--- 1,14 ----
+ /* { dg-do compile } */
+ /* { dg-options "-O -fno-tree-fre -w -Wno-psabi" } */
+
+ typedef unsigned v2ti __attribute__ ((vector_size (32)));
+
+ v2ti
+ foo (v2ti u, v2ti v)
+ {
+   u[0] >>= 0xf;
+   v ^= ~v;
+   v &= ~u;
+   v -= -u;
+   return v;
+ }


--
Marc Glisse

Reply via email to