This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix PR70372


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  <rguenther@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.

	* 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;
+ }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]