tree-loop-distribution.c (can_generate_builtin): Reject volatile stmts.

2012-05-21  Richard Guenther  <rguenther@suse.de>

	* tree-loop-distribution.c (can_generate_builtin): Reject
	volatile stmts.

	* gcc.dg/torture/ldist-1.c: New testcase.

From-SVN: r187707
This commit is contained in:
Richard Guenther 2012-05-21 10:46:19 +00:00 committed by Richard Biener
parent 6be4d3acd0
commit 8450aa9720
4 changed files with 24 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2012-05-21 Richard Guenther <rguenther@suse.de>
* tree-loop-distribution.c (can_generate_builtin): Reject
volatile stmts.
2012-05-21 Chung-Lin Tang <cltang@codesourcery.com>
* Makefile.in (options.c): Add options.h to included header

View File

@ -1,3 +1,7 @@
2012-05-21 Richard Guenther <rguenther@suse.de>
* gcc.dg/torture/ldist-1.c: New testcase.
2012-05-20 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/lto13.adb: New test.

View File

@ -0,0 +1,12 @@
/* { dg-do compile } */
/* { dg-options "-ftree-loop-distribute-patterns" } */
void foo (volatile int *p, int n)
{
int i;
for (i = 0; i < n; ++i)
p[i] = 0;
}
/* { dg-final { scan-assembler-not "memset" } } */
/* { dg-final { cleanup-tree-dump "ldist" } } */

View File

@ -822,8 +822,10 @@ can_generate_builtin (struct graph *rdg, bitmap partition)
nb_reads++;
else if (RDG_MEM_WRITE_STMT (rdg, i))
{
gimple stmt = RDG_STMT (rdg, i);
nb_writes++;
if (stmt_with_adjacent_zero_store_dr_p (RDG_STMT (rdg, i)))
if (!gimple_has_volatile_ops (stmt)
&& stmt_with_adjacent_zero_store_dr_p (stmt))
stores_zero++;
}