summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2007-05-12 17:21:43 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2007-05-12 17:21:43 +0000
commita540e2fee77d3352a3c91f4df0f6d3f34380a0d6 (patch)
treef25032dcb72bc99b2224beb492c056771db89662
parent88a3dcb7ccf40c2b6c098255262114f2755d8cc6 (diff)
downloadppe42-gcc-a540e2fee77d3352a3c91f4df0f6d3f34380a0d6.tar.gz
ppe42-gcc-a540e2fee77d3352a3c91f4df0f6d3f34380a0d6.zip
2007-05-12 Richard Guenther <rguenther@suse.de>
PR tree-optimization/31797 * tree-ssa-forwprop.c (forward_propagate_addr_expr): Do not propagate into a stmt that has volatile ops. * gcc.c-torture/compile/pr31797.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124637 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr31797.c31
-rw-r--r--gcc/tree-ssa-forwprop.c11
4 files changed, 51 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 01ce517bcca..bc7e921124f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2007-05-12 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/31797
+ * tree-ssa-forwprop.c (forward_propagate_addr_expr): Do not
+ propagate into a stmt that has volatile ops.
+
2007-05-12 Richard Sandiford <richard@codesourcery.com>
* configure.ac (gcc_gxx_include_dir): Use $(libsubdir_to_prefix).
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 3109938e702..b4ad8f7384b 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2007-05-12 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/31797
+ * gcc.c-torture/compile/pr31797.c: New testcase.
+
2007-05-12 Paul Thomas <pault@gcc.gnu.org>
PR fortran/30746
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr31797.c b/gcc/testsuite/gcc.c-torture/compile/pr31797.c
new file mode 100644
index 00000000000..97958f38929
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr31797.c
@@ -0,0 +1,31 @@
+struct GTeth_desc
+{
+ unsigned ed_cmdsts;
+};
+struct GTeth_softc
+{
+ struct GTeth_desc txq_desc[32];
+ unsigned int txq_fi;
+ unsigned int txq_nactive;
+};
+
+void
+GTeth_txq_free (struct GTeth_softc *sc)
+{
+ struct GTeth_desc *txd = &sc->txq_desc[0];
+ txd->ed_cmdsts &= ~(1U << (31));
+}
+void
+GTeth_txq_done (struct GTeth_softc *sc)
+{
+ while (sc->txq_nactive > 0)
+ {
+ volatile struct GTeth_desc *txd = &sc->txq_desc[sc->txq_fi];
+ if (txd->ed_cmdsts)
+ {
+ if (sc->txq_nactive == 1)
+ return;
+ }
+ GTeth_txq_free (sc);
+ }
+}
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index d91aa89325d..2afdd9a6332 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -727,7 +727,7 @@ forward_propagate_addr_expr (tree name, tree rhs)
continue;
}
- /* If the use is in a deeper loop nest, then we do not want
+ /* If the use is in a deeper loop nest, then we do not want
to propagate the ADDR_EXPR into the loop as that is likely
adding expression evaluations into the loop. */
if (bb_for_stmt (use_stmt)->loop_depth > stmt_loop_depth)
@@ -735,7 +735,14 @@ forward_propagate_addr_expr (tree name, tree rhs)
all = false;
continue;
}
-
+
+ /* If the use_stmt has side-effects, don't propagate into it. */
+ if (stmt_ann (use_stmt)->has_volatile_ops)
+ {
+ all = false;
+ continue;
+ }
+
push_stmt_changes (&use_stmt);
result = forward_propagate_addr_expr_1 (name, rhs, use_stmt,
OpenPOWER on IntegriCloud