re PR middle-end/50333 (internal compiler error: in extract_ops_from_tree, at gimple...
authorRichard Guenther <rguenther@suse.de>
Fri, 9 Sep 2011 09:06:49 +0000 (09:06 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 9 Sep 2011 09:06:49 +0000 (09:06 +0000)
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.

From-SVN: r178720

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr50333.c [new file with mode: 0644]
gcc/tree-data-ref.c

index dbda61cef07a9995922466ba3c025809ea295c60..d04c2e94ea3e12304879a15c898796ffd1762e3d 100644 (file)
@@ -1,3 +1,9 @@
+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.
+
 2011-09-08  Andrew Stubbs  <ams@codesourcery.com>
 
        PR tree-optimization/50318
index 1d77d7b383d75095a286f766dd727392fdbc5ee1..f0a53831ca4c3348df70c51523e61b16ba8a892e 100644 (file)
@@ -1,3 +1,8 @@
+2011-09-09  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/50333
+       * gcc.dg/torture/pr50333.c: New testcase.
+
 2011-09-08  Andrew Stubbs  <ams@codesourcery.com>
 
        PR tree-optimization/50318
diff --git a/gcc/testsuite/gcc.dg/torture/pr50333.c b/gcc/testsuite/gcc.dg/torture/pr50333.c
new file mode 100644 (file)
index 0000000..47577dc
--- /dev/null
@@ -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);
+}
index 388ea8aaeb22e4319f9d0178a60852f0142ecc8c..72ecfe9a8c89388283ac7475e0cce50edb0c3063 100644 (file)
@@ -686,7 +686,8 @@ split_constant_offset (tree exp, tree *var, tree *off)
   *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);