Commit 1bce4ff3 by Richard Guenther Committed by Richard Biener

re PR tree-optimization/48134 (ICE: in refs_may_alias_p_1, at…

re PR tree-optimization/48134 (ICE: in refs_may_alias_p_1, at tree-ssa-alias.c:1085 with custom flags)

2011-03-17  Richard Guenther  <rguenther@suse.de>

	PR middle-end/48134
	* tree-ssa.c (insert_debug_temp_for_var_def): If we propagated
	a value make sure to fold the statement.

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

From-SVN: r171098
parent 7c71147d
2011-03-17 Richard Guenther <rguenther@suse.de>
PR middle-end/48134
* tree-ssa.c (insert_debug_temp_for_var_def): If we propagated
a value make sure to fold the statement.
2011-03-17 Chung-Lin Tang <cltang@codesourcery.com> 2011-03-17 Chung-Lin Tang <cltang@codesourcery.com>
PR target/43872 PR target/43872
......
2011-03-17 Richard Guenther <rguenther@suse.de> 2011-03-17 Richard Guenther <rguenther@suse.de>
PR middle-end/48134
* gcc.dg/pr48134.c: New testcase.
2011-03-17 Richard Guenther <rguenther@suse.de>
PR middle-end/48165 PR middle-end/48165
* g++.dg/torture/pr48165.C: New testcase. * g++.dg/torture/pr48165.C: New testcase.
......
/* { dg-do compile } */
/* { dg-options "-O2 -fstack-check=specific -fno-tree-dse -fno-tree-fre -fno-tree-loop-optimize -g" } */
struct S
{
int w, z;
};
struct T
{
struct S s;
};
int i;
static inline struct S
bar (struct S x)
{
i++;
return x;
}
int
foo (struct T t, struct S s)
{
struct S *c = &s;
if (i)
c = &t.s;
t.s.w = 3;
s = bar (*c);
return t.s.w;
}
...@@ -455,13 +455,19 @@ insert_debug_temp_for_var_def (gimple_stmt_iterator *gsi, tree var) ...@@ -455,13 +455,19 @@ insert_debug_temp_for_var_def (gimple_stmt_iterator *gsi, tree var)
continue; continue;
if (value) if (value)
FOR_EACH_IMM_USE_ON_STMT (use_p, imm_iter) {
/* unshare_expr is not needed here. vexpr is either a FOR_EACH_IMM_USE_ON_STMT (use_p, imm_iter)
SINGLE_RHS, that can be safely shared, some other RHS /* unshare_expr is not needed here. vexpr is either a
that was unshared when we found it had a single debug SINGLE_RHS, that can be safely shared, some other RHS
use, or a DEBUG_EXPR_DECL, that can be safely that was unshared when we found it had a single debug
shared. */ use, or a DEBUG_EXPR_DECL, that can be safely
SET_USE (use_p, value); shared. */
SET_USE (use_p, value);
/* If we didn't replace uses with a debug decl fold the
resulting expression. Otherwise we end up with invalid IL. */
if (TREE_CODE (value) != DEBUG_EXPR_DECL)
fold_stmt_inplace (stmt);
}
else else
gimple_debug_bind_reset_value (stmt); gimple_debug_bind_reset_value (stmt);
......
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