Commit e665269a by Richard Guenther Committed by Richard Biener

re PR tree-optimization/54981 (Different code generated with / without `-g')

2012-10-19  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/54981
	* tree-loop-distribution.c (ssa_name_has_uses_outside_loop_p):
	Do not consider debug stmts as uses.

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

From-SVN: r192612
parent dfc2e2ac
2012-10-19 Richard Guenther <rguenther@suse.de>
PR tree-optimization/54981
* tree-loop-distribution.c (ssa_name_has_uses_outside_loop_p):
Do not consider debug stmts as uses.
2012-10-19 Richard Biener <rguenther@suse.de>
PR tree-optimization/54976
2012-10-19 Richard Guenther <rguenther@suse.de>
PR tree-optimization/54981
* gcc.dg/pr54981.c: New testcase.
2012-10-19 Zhenqiang Chen <zhenqiang.chen@linaro.org>
PR target/54892
......
/* { dg-do compile } */
/* { dg-options "-O -ftree-loop-distribute-patterns -fcompare-debug" } */
extern void bar(unsigned *, char *);
void foo(char *s)
{
unsigned i;
char t[2];
bar(&i, t);
for (i = 0; i < 2; i++)
s[i] = t[i];
}
......@@ -125,8 +125,12 @@ ssa_name_has_uses_outside_loop_p (tree def, loop_p loop)
use_operand_p use_p;
FOR_EACH_IMM_USE_FAST (use_p, imm_iter, def)
if (loop != loop_containing_stmt (USE_STMT (use_p)))
return true;
{
gimple use_stmt = USE_STMT (use_p);
if (!is_gimple_debug (use_stmt)
&& loop != loop_containing_stmt (use_stmt))
return true;
}
return false;
}
......
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