Commit 277dc810 by Jakub Jelinek Committed by Jakub Jelinek

re PR middle-end/46360 (ICE in release_defs, at tree-ssanames.c:313)

	PR middle-end/46360
	* tree-ssa-propagate.c (update_call_from_tree): Fix for use
	not in SSA mode.

	* gcc.c-torture/compile/pr46360.c: New test.

From-SVN: r166482
parent 8810610e
2010-11-09 Jakub Jelinek <jakub@redhat.com>
PR middle-end/46360
* tree-ssa-propagate.c (update_call_from_tree): Fix for use
not in SSA mode.
2010-11-09 Richard Guenther <rguenther@suse.de>
PR middle-end/46221
2010-11-09 Jakub Jelinek <jakub@redhat.com>
PR middle-end/46360
* gcc.c-torture/compile/pr46360.c: New test.
PR c++/45894
* g++.dg/warn/Wsequence-point-2.C: New test.
......
/* PR middle-end/46360 */
__attribute__((gnu_inline, always_inline)) extern inline char *
strncpy (char *dest, const char *src, __SIZE_TYPE__ len)
{
return __builtin_strncpy (dest, src, len);
}
void
foo (char *s)
{
strncpy (s, "", 0);
}
......@@ -760,8 +760,11 @@ update_call_from_tree (gimple_stmt_iterator *si_p, tree expr)
/* No value is expected, and EXPR has no effect.
Replace it with an empty statement. */
new_stmt = gimple_build_nop ();
unlink_stmt_vdef (stmt);
release_defs (stmt);
if (gimple_in_ssa_p (cfun))
{
unlink_stmt_vdef (stmt);
release_defs (stmt);
}
}
else
{
......@@ -773,7 +776,8 @@ update_call_from_tree (gimple_stmt_iterator *si_p, tree expr)
lhs = create_tmp_var (TREE_TYPE (expr), NULL);
new_stmt = gimple_build_assign (lhs, expr);
add_referenced_var (lhs);
lhs = make_ssa_name (lhs, new_stmt);
if (gimple_in_ssa_p (cfun))
lhs = make_ssa_name (lhs, new_stmt);
gimple_assign_set_lhs (new_stmt, lhs);
gimple_set_vuse (new_stmt, gimple_vuse (stmt));
gimple_set_vdef (new_stmt, gimple_vdef (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