Commit 301bbc16 by Richard Biener Committed by Richard Biener

re PR tree-optimization/58246 (wrong code at -O1 and above)

2013-08-29  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/58246
	* tree-ssa-dce.c (mark_aliased_reaching_defs_necessary_1): Properly
	handle the dominance check inside a basic-block.

	* gcc.dg/torture/pr58246.c: New testcase.

From-SVN: r202071
parent 4860a462
2013-08-29 Richard Biener <rguenther@suse.de> 2013-08-29 Richard Biener <rguenther@suse.de>
PR tree-optimization/58246
* tree-ssa-dce.c (mark_aliased_reaching_defs_necessary_1): Properly
handle the dominance check inside a basic-block.
2013-08-29 Richard Biener <rguenther@suse.de>
PR middle-end/57287 PR middle-end/57287
* tree-ssa-copy.c (may_propagate_copy): Allow propagating * tree-ssa-copy.c (may_propagate_copy): Allow propagating
of default defs that appear in abnormal PHI nodes. of default defs that appear in abnormal PHI nodes.
......
2013-08-29 Richard Biener <rguenther@suse.de>
PR tree-optimization/58246
* gcc.dg/torture/pr58246.c: New testcase.
2013-08-29 Thomas Koenig <tkoenig@gcc.gnu.org> 2013-08-29 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/52243 PR fortran/52243
......
/* { dg-do run } */
extern void abort (void);
int a, b;
int main ()
{
int t[2] = {1,1};
for (a = 0; a < 2; a++)
{
b ^= t[a];
t[a] = t[1] = 0;
}
if (b != 1)
abort ();
return 0;
}
...@@ -574,6 +574,11 @@ mark_aliased_reaching_defs_necessary_1 (ao_ref *ref, tree vdef, void *data) ...@@ -574,6 +574,11 @@ mark_aliased_reaching_defs_necessary_1 (ao_ref *ref, tree vdef, void *data)
in the references (gcc.c-torture/execute/pr42142.c). in the references (gcc.c-torture/execute/pr42142.c).
The simplest way is to check if the kill dominates The simplest way is to check if the kill dominates
the use. */ the use. */
/* But when both are in the same block we cannot
easily tell whether we came from a backedge
unless we decide to compute stmt UIDs
(see PR58246). */
&& (basic_block) data != gimple_bb (def_stmt)
&& dominated_by_p (CDI_DOMINATORS, (basic_block) data, && dominated_by_p (CDI_DOMINATORS, (basic_block) data,
gimple_bb (def_stmt)) gimple_bb (def_stmt))
&& operand_equal_p (ref->ref, lhs, 0)) && operand_equal_p (ref->ref, lhs, 0))
......
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