Commit 525fb35c by Richard Guenther Committed by Richard Biener

re PR tree-optimization/45449 (-fcompare-debug failure with -O2 -fno-tree-pre -fno-tree-pta)

2010-08-30  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/45449
	* tree-ssa-live.c (remove_unused_locals): Also remove address-taken
	variables.

	* gcc.dg/pr45449.c: New testcase.

From-SVN: r163638
parent 184eb658
2010-08-30 Richard Guenther <rguenther@suse.de>
PR tree-optimization/45449
* tree-ssa-live.c (remove_unused_locals): Also remove address-taken
variables.
2010-08-30 Joseph Myers <joseph@codesourcery.com>
* opts.h (CL_ERR_NEGATIVE): Define.
......
2010-08-30 Richard Guenther <rguenther@suse.de>
PR tree-optimization/45449
* gcc.dg/pr45449.c: New testcase.
2010-08-30 Joseph Myers <joseph@codesourcery.com>
* gcc.dg/opts-1.c: Expect errors, not warnings.
......
/* { dg-do compile } */
/* { dg-options "-O2 -fno-tree-pre -fno-tree-pta -fcompare-debug" } */
struct S
{
};
void
baz (void)
{
struct S s;
&s;
}
int bar (void);
void
foo (void)
{
if (bar ())
baz ();
}
......@@ -813,18 +813,13 @@ remove_unused_locals (void)
BITMAP_FREE (global_unused_vars);
}
/* Remove unused variables from REFERENCED_VARs. As a special
exception keep the variables that are believed to be aliased.
Those can't be easily removed from the alias sets and operand
caches. They will be removed shortly after the next may_alias
pass is performed. */
/* Remove unused variables from REFERENCED_VARs. */
FOR_EACH_REFERENCED_VAR (t, rvi)
if (!is_global_var (t)
&& TREE_CODE (t) != PARM_DECL
&& TREE_CODE (t) != RESULT_DECL
&& !(ann = var_ann (t))->used
&& !ann->is_heapvar
&& !TREE_ADDRESSABLE (t))
&& !ann->is_heapvar)
remove_referenced_var (t);
remove_unused_scope_block_p (DECL_INITIAL (current_function_decl));
if (dump_file && (dump_flags & TDF_DETAILS))
......
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