Commit 06e1d03d by Jakub Jelinek Committed by Jakub Jelinek

re PR tree-optimization/51987 (Predictive commoning wrong-code with non-volatile asm)

	PR tree-optimization/51987
	* tree-data-ref.c (get_references_in_stmt): Handle references in
	non-volatile GIMPLE_ASM.

	* gcc.target/i386/pr51987.c: New test.

From-SVN: r183524
parent 8bf43909
2012-01-25 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/51987
* tree-data-ref.c (get_references_in_stmt): Handle references in
non-volatile GIMPLE_ASM.
2012-01-25 Richard Guenther <rguenther@suse.de>
* tree-ssa-sccvn.c (vn_reference_eq): Also compare if both
......
2012-01-25 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/51987
* gcc.target/i386/pr51987.c: New test.
2012-01-25 Greta Yorsh <Greta.Yorsh@arm.com>
* gcc.dg/tm/lto-1.c: Require lto support in target.
......
/* PR tree-optimization/51987 */
/* { dg-do run { target { ! { ia32 } } } } */
/* { dg-options "-O3" } */
extern void abort (void);
union U { unsigned long long l; struct { unsigned int l, h; } i; };
__attribute__((noinline, noclone)) void
foo (char *x, char *y)
{
int i;
for (i = 0; i < 64; i++)
{
union U u;
asm ("movl %1, %k0; salq $32, %0" : "=r" (u.l) : "r" (i));
x[i] = u.i.h;
union U v;
asm ("movl %1, %k0; salq $32, %0" : "=r" (v.l) : "r" (i));
y[i] = v.i.h;
}
}
int
main ()
{
char a[64], b[64];
int i;
foo (a, b);
for (i = 0; i < 64; i++)
if (a[i] != i || b[i] != i)
abort ();
return 0;
}
/* Data references and dependences detectors.
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
Contributed by Sebastian Pop <pop@cri.ensmp.fr>
......@@ -4185,7 +4185,7 @@ get_references_in_stmt (gimple stmt, VEC (data_ref_loc, heap) **references)
if ((stmt_code == GIMPLE_CALL
&& !(gimple_call_flags (stmt) & (ECF_CONST | ECF_PURE)))
|| (stmt_code == GIMPLE_ASM
&& gimple_asm_volatile_p (stmt)))
&& (gimple_asm_volatile_p (stmt) || gimple_vuse (stmt))))
clobbers_memory = true;
if (!gimple_vuse (stmt))
......
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