aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2004-06-08 05:21:51 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2004-06-08 05:21:51 +0000
commit0b1d52f74522f2e1ab43a0ada8ad1c89f6daeac5 (patch)
tree07c443a88da1d8140be976bcd9105c71c00a434d
parent5bbb9680379fdd9ac147a9e734c0b11d774c4e04 (diff)
downloadgcc-0b1d52f74522f2e1ab43a0ada8ad1c89f6daeac5.zip
gcc-0b1d52f74522f2e1ab43a0ada8ad1c89f6daeac5.tar.gz
gcc-0b1d52f74522f2e1ab43a0ada8ad1c89f6daeac5.tar.bz2
gimplify.c (copy_if_shared_r): Revert: 2004-05-21 Richard Henderson <rth@redhat.com>
* gimplify.c (copy_if_shared_r): Revert: 2004-05-21 Richard Henderson <rth@redhat.com> * gimplify.c [...] Don't mark VA_ARG_EXPRs volatile here. From-SVN: r82745
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/gimplify.c14
2 files changed, 19 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 355a54b..aec3ed2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2004-06-08 Alexandre Oliva <aoliva@redhat.com>
+
+ * gimplify.c (copy_if_shared_r): Revert:
+ 2004-05-21 Richard Henderson <rth@redhat.com>
+ * gimplify.c [...] Don't mark VA_ARG_EXPRs volatile here.
+
2004-06-07 Roger Sayle <roger@eyesopen.com>
* expmed.c (add_cost, neg_cost, sdiv_pow2_cheap, smod_pow2_cheap):
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 8ec6e0d..679103e 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -665,7 +665,19 @@ copy_if_shared_r (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED,
/* Otherwise, mark the tree as visited and keep looking. */
else
- TREE_VISITED (t) = 1;
+ {
+ TREE_VISITED (t) = 1;
+ if (TREE_CODE (*tp) == VA_ARG_EXPR)
+ {
+ /* Mark any _DECL inside the operand as volatile to avoid
+ the optimizers messing around with it. We have to do this
+ early, otherwise we might mark a variable as volatile
+ after we gimplify other statements that use the variable
+ assuming it's not volatile. */
+ walk_tree (&TREE_OPERAND (*tp, 0), mark_decls_volatile_r,
+ NULL, NULL);
+ }
+ }
return NULL_TREE;
}