From ef72faafed9afb201c610dba63a17296829ce9b5 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 21 Dec 2010 09:35:16 +0100 Subject: 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 --- gcc/expr.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gcc/expr.c') 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 -- cgit v1.1