diff mbox

Fix PR50333

Message ID alpine.LNX.2.00.1109090944120.2130@zhemvz.fhfr.qr
State New
Headers show

Commit Message

Richard Biener Sept. 9, 2011, 7:45 a.m. UTC
This fixes PR50333, another instance of a extract_ops_from_tree user
that doesn't handle ternaries.

Bootstrap and testing pending on x86_64-unknown-linux-gnu.

Richard.

2011-09-09  Richard Guenther  <rguenther@suse.de>

	PR middle-end/50333
	* tree-data-ref.c (split_constant_offset): Do not try to handle
	ternary ops.

	* gcc.dg/torture/pr50333.c: New testcase.
diff mbox

Patch

Index: gcc/tree-data-ref.c
===================================================================
--- gcc/tree-data-ref.c	(revision 178719)
+++ gcc/tree-data-ref.c	(working copy)
@@ -686,7 +686,8 @@  split_constant_offset (tree exp, tree *v
   *off = ssize_int (0);
   STRIP_NOPS (exp);
 
-  if (tree_is_chrec (exp))
+  if (tree_is_chrec (exp)
+      || get_gimple_rhs_class (TREE_CODE (exp)) == GIMPLE_TERNARY_RHS)
     return;
 
   otype = TREE_TYPE (exp);
Index: gcc/testsuite/gcc.dg/torture/pr50333.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/pr50333.c	(revision 0)
+++ gcc/testsuite/gcc.dg/torture/pr50333.c	(revision 0)
@@ -0,0 +1,17 @@ 
+/* { dg-do compile } */
+
+static inline void
+unext(unsigned int *_ui, unsigned _len, unsigned int _ui0)
+{
+    unsigned j = 1;
+    while (++j<_len)
+      ;
+    _ui[j-1]=_ui0;
+}
+unsigned int
+ncwrs_urow(unsigned _n, unsigned _k, unsigned int *_u)
+{
+  unsigned k;
+  for(k=2; k<_n; k++)
+    unext(_u+1,_k+1,1);
+}