re PR tree-optimization/37617 (ICE on valid code)

2008-10-01  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/37617
	* tree-ssa-pre.c (create_expression_by_pieces): During FRE
	do not add to the NEW_SETS.

	* gcc.c-torture/compile/pr37617.c: New testcase.

From-SVN: r140816
This commit is contained in:
Richard Guenther 2008-10-01 16:23:23 +00:00 committed by Richard Biener
parent 256f88c6c0
commit c8ce33fa7f
4 changed files with 32 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2008-10-01 Richard Guenther <rguenther@suse.de>
PR tree-optimization/37617
* tree-ssa-pre.c (create_expression_by_pieces): During FRE
do not add to the NEW_SETS.
2008-10-01 Richard Guenther <rguenther@suse.de>
PR middle-end/37285

View File

@ -1,3 +1,8 @@
2008-10-01 Richard Guenther <rguenther@suse.de>
PR tree-optimization/37617
* gcc.c-torture/compile/pr37617.c: New testcase.
2008-10-01 Richard Guenther <rguenther@suse.de>
PR middle-end/37285

View File

@ -0,0 +1,19 @@
typedef union
{
char *string;
double dval;
float fval;
} yystype;
char *f(void)
{
yystype tok;
tok.dval = 0;
return (tok.string);
}
char *f1(void)
{
yystype tok;
tok.fval = 0;
return (tok.string);
}

View File

@ -2885,7 +2885,8 @@ create_expression_by_pieces (basic_block block, pre_expr expr,
VN_INFO (forcedname)->value_id = get_next_value_id ();
nameexpr = get_or_alloc_expr_for_name (forcedname);
add_to_value (VN_INFO (forcedname)->value_id, nameexpr);
bitmap_value_replace_in_set (NEW_SETS (block), nameexpr);
if (!in_fre)
bitmap_value_replace_in_set (NEW_SETS (block), nameexpr);
bitmap_value_replace_in_set (AVAIL_OUT (block), nameexpr);
}
mark_symbols_for_renaming (stmt);