re PR tree-optimization/53085 (writes to volatile struct members is missing)

2012-04-24  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/53085
	* tree-ssa-pre.c (eliminate): Do not eliminate volatile redundant
	stores.

	* g++.dg/torture/pr53085.C: New testcase.

From-SVN: r186765
This commit is contained in:
Richard Guenther 2012-04-24 14:42:53 +00:00 committed by Richard Biener
parent a2e8e5e32d
commit 10632cb2bf
4 changed files with 29 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2012-04-24 Richard Guenther <rguenther@suse.de>
PR tree-optimization/53085
* tree-ssa-pre.c (eliminate): Do not eliminate volatile redundant
stores.
2012-04-24 Jakub Jelinek <jakub@redhat.com>
PR middle-end/53084

View File

@ -1,3 +1,8 @@
2012-04-24 Richard Guenther <rguenther@suse.de>
PR tree-optimization/53085
* g++.dg/torture/pr53085.C: New testcase.
2012-04-23 Richard Guenther <rguenther@suse.de>
PR c/53060

View File

@ -0,0 +1,17 @@
// { dg-do compile }
// { dg-skip-if "" { *-*-* } { "-fno-fat-lto-objects" } { "" } }
// { dg-options "-fdump-tree-optimized" }
class aa{
void f();
private:
volatile int a;
};
void aa::f(){
a=1;
a=1;
}
// { dg-final { scan-tree-dump-times "a ={v} 1;" 2 "optimized" } }
// { dg-final { cleanup-tree-dump "optimized" } }

View File

@ -4337,6 +4337,7 @@ eliminate (void)
has the same value number as its rhs. If so, the store is
dead. */
else if (gimple_assign_single_p (stmt)
&& !gimple_has_volatile_ops (stmt)
&& !is_gimple_reg (gimple_assign_lhs (stmt))
&& (TREE_CODE (rhs) == SSA_NAME
|| is_gimple_min_invariant (rhs)))