diff options
author | Diego Novillo <dnovillo@redhat.com> | 2004-07-29 17:15:38 +0000 |
---|---|---|
committer | Diego Novillo <dnovillo@gcc.gnu.org> | 2004-07-29 13:15:38 -0400 |
commit | d397dbcd99452ed440e1a99495436af91513a5ac (patch) | |
tree | 7220d1120c147f0275d6a78b7a6a7a25a2396916 /gcc | |
parent | 9d6e0be1f607c2289a000018eac74ff322ff3f52 (diff) | |
download | gcc-d397dbcd99452ed440e1a99495436af91513a5ac.zip gcc-d397dbcd99452ed440e1a99495436af91513a5ac.tar.gz gcc-d397dbcd99452ed440e1a99495436af91513a5ac.tar.bz2 |
tree-ssa-operands.c (get_expr_operands): Revert changes to ADDR_EXPR processing introduced by...
* tree-ssa-operands.c (get_expr_operands): Revert changes
to ADDR_EXPR processing introduced by:
2004-06-21 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* tree-ssa-operands.c (get_expr_operands): Minor rearrangements.
testsuite/ChangeLog
* gcc.dg/tree-ssa/20040729-1.c: New test.
From-SVN: r85306
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/20040729-1.c | 18 | ||||
-rw-r--r-- | gcc/tree-ssa-operands.c | 6 |
4 files changed, 32 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 22fa108..1d17875 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2004-07-29 Diego Novillo <dnovillo@redhat.com> + + * tree-ssa-operands.c (get_expr_operands): Revert changes + to ADDR_EXPR processing introduced by: + 2004-06-21 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> + * tree-ssa-operands.c (get_expr_operands): Minor rearrangements. + 2004-07-29 Joseph S. Myers <jsm@polyomino.org.uk> * doc/implement-c.texi: Add C90 subclause references. Point to diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2bb5259..c82cbe5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2004-07-29 Diego Novillo <dnovillo@redhat.com> + + * gcc.dg/tree-ssa/20040729-1.c: New test. + 2004-07-27 Matt Austern <austern@apple.com> * gcc.dg/darwin-bool-1.c: New test. diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20040729-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20040729-1.c new file mode 100644 index 0000000..6543163 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/20040729-1.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-O1 -fdump-tree-dce3" } */ + +foo () +{ + volatile int *p; + volatile int x; + + p = &x; + *p = 3; + return *p + 1; +} + +/* The assignment to 'p' is dead and should be removed. But the + compiler was mistakenly thinking that the statement had volatile + operands. But 'p' itself is not volatile and taking the address of + a volatile does not constitute a volatile operand. */ +/* { dg-final { scan-tree-dump-times "&x" 0 "dce3"} } */ diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c index a9e864e..4b1e37f 100644 --- a/gcc/tree-ssa-operands.c +++ b/gcc/tree-ssa-operands.c @@ -859,9 +859,9 @@ get_expr_operands (tree stmt, tree *expr_p, int flags, voperands_t prev_vops) of interest to some passes (e.g. alias resolution). */ add_stmt_operand (expr_p, stmt, 0, NULL); - /* If the address is constant (invariant is not sufficient), there will - be no interesting variable references inside. */ - if (TREE_CONSTANT (expr)) + /* If the address is invariant, there may be no interesting variable + references inside. */ + if (is_gimple_min_invariant (expr)) return; /* There should be no VUSEs created, since the referenced objects are |