aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2010-12-21 09:35:16 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2010-12-21 09:35:16 +0100
commitef72faafed9afb201c610dba63a17296829ce9b5 (patch)
tree4c2830d0ded232e8700d8c5b92786884bddbd587 /gcc/expr.c
parent486b10aa89499699906fecc6630fbdc7b26996b2 (diff)
downloadgcc-ef72faafed9afb201c610dba63a17296829ce9b5.zip
gcc-ef72faafed9afb201c610dba63a17296829ce9b5.tar.gz
gcc-ef72faafed9afb201c610dba63a17296829ce9b5.tar.bz2
re PR middle-end/45852 (volatile structs are broken!)
PR middle-end/45852 * expr.c (store_expr): Ignore alt_rtl if equal to target, but has side-effects. * gcc.target/i386/pr45852.c: New test. From-SVN: r168105
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 56a6249..cd32f4f 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -4712,7 +4712,10 @@ store_expr (tree exp, rtx target, int call_param_p, bool nontemporal)
/* If store_expr stores a DECL whose DECL_RTL(exp) == TARGET,
but TARGET is not valid memory reference, TEMP will differ
from TARGET although it is really the same location. */
- && !(alt_rtl && rtx_equal_p (alt_rtl, target))
+ && !(alt_rtl
+ && rtx_equal_p (alt_rtl, target)
+ && !side_effects_p (alt_rtl)
+ && !side_effects_p (target))
/* If there's nothing to copy, don't bother. Don't call
expr_size unless necessary, because some front-ends (C++)
expr_size-hook must not be given objects that are not