Commit ef72faaf by Jakub Jelinek Committed by Jakub Jelinek

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
parent 486b10aa
2010-12-21 Jakub Jelinek <jakub@redhat.com>
PR middle-end/45852
* expr.c (store_expr): Ignore alt_rtl if equal to target,
but has side-effects.
2010-12-21 Anatoly Sokolov <aesok@post.ru>
* config/sh/sh.h (PREFERRED_RELOAD_CLASS): Remove.
......@@ -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
......
2010-12-21 Jakub Jelinek <jakub@redhat.com>
PR middle-end/45852
* gcc.target/i386/pr45852.c: New test.
2010-12-20 Tobias Burnus <burnus@net-b.de>
PR fortran/46974
......
/* PR middle-end/45852 */
/* { dg-options "-O2 -mcmodel=small" } */
/* { dg-do compile { target { { i?86-*-linux* x86_64-*-linux* } && lp64 } } } */
/* { dg-require-visibility "" } */
struct S { int s; };
volatile struct S globvar __attribute__((visibility ("hidden"))) = { -6 };
void
foo (void)
{
globvar = globvar;
}
/* { dg-final { scan-assembler-times "globvar.%?rip" 2 } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment