re PR target/71185 (ice in gimplify_modify_expr, at gimplify.c:4873)
authorRichard Biener <rguenther@suse.de>
Fri, 20 May 2016 09:09:28 +0000 (09:09 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 20 May 2016 09:09:28 +0000 (09:09 +0000)
2016-05-20  Richard Biener  <rguenther@suse.de>

PR tree-optimization/71185
* tree-ssa-loop-prefetch.c (gather_memory_references): Drop
register operations.

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

From-SVN: r236499

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/pr71185.c [new file with mode: 0644]
gcc/tree-ssa-loop-prefetch.c

index 8471e8a01f4522bee35f4dae8ddbe190a536f67b..83a6f3cc5662ff6ea7aa72cd0d15c1c07a1035a2 100644 (file)
@@ -1,3 +1,9 @@
+2016-05-20  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/71185
+       * tree-ssa-loop-prefetch.c (gather_memory_references): Drop
+       register operations.
+
 2016-05-20  Richard Biener  <rguenther@suse.de>
 
        * tree-if-conv.c (add_bb_predicate_gimplified_stmts): Use
index 0c2f4bc2dfead7da6434f7d515d797bf4fd38cd3..87588f0212981f27a0e29197e0f3bc2f6def4f3d 100644 (file)
@@ -1,3 +1,8 @@
+2016-05-20  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/71185
+       * gcc.dg/tree-ssa/pr71185.c: New testcase.
+
 2016-05-20  Richard Biener  <rguenther@suse.de>
 
        * gcc.dg/tree-ssa/ifc-cd.c: Adjust.
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr71185.c b/gcc/testsuite/gcc.dg/tree-ssa/pr71185.c
new file mode 100644 (file)
index 0000000..c2e246f
--- /dev/null
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+/* { dg-options "-O3 -march=barcelona" { target x86_64-*-* i?86-*-* } } */
+
+union U { struct S { int l; int m; } p; long long a; } b;
+int a, c;
+
+void
+foo ()
+{
+  for (; b.p.m; b.a += c)
+    a = b.p.l / 65536.0 * 65536.0;
+}
index 49fd597a892e63a51523e75e4d4af95d814f72ce..fb8c476376934b3d6196f0efecfe3bdd6d042457 100644 (file)
@@ -631,6 +631,9 @@ gather_memory_references (struct loop *loop, bool *no_other_refs, unsigned *ref_
              continue;
            }
 
+         if (! gimple_vuse (stmt))
+           continue;
+
          lhs = gimple_assign_lhs (stmt);
          rhs = gimple_assign_rhs1 (stmt);