OSDN Git Service

2011-09-09 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 9 Sep 2011 09:06:49 +0000 (09:06 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 9 Sep 2011 09:06:49 +0000 (09:06 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178720 138bc75d-0d04-0410-961f-82ee72b054a4

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

index dbda61c..d04c2e9 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 1d77d7b..f0a5383 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 388ea8a..72ecfe9 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);