re PR regression/20139 (cris-elf testsuite: gcc.c-torture/execute/20020720-1.c)

PR tree-optimization/20139
	* tree-cfg.c (remove_bb): Check in_ssa_p before calling
	release_defs.
	* tree-optimize.c (execute_cleanup_cfg_post_optimizing): Call
	fold_cond_expr_cond.
	* tree-ssanames.c (release_defs): Assert in_ssa_p.
	* tree.c (upper_bound_in_type, lower_bound_in_type): Rewrite.

From-SVN: r101787
This commit is contained in:
Kazu Hirata 2005-07-08 19:11:55 +00:00 committed by Kazu Hirata
parent ea9a5df4c2
commit 1ff54bfbdb
6 changed files with 47 additions and 1 deletions

View File

@ -7,6 +7,14 @@
(lower_bound_in_type): Fix calculations for casting to a
non-wider signed type.
PR tree-optimization/20139
* tree-cfg.c (remove_bb): Check in_ssa_p before calling
release_defs.
* tree-optimize.c (execute_cleanup_cfg_post_optimizing): Call
fold_cond_expr_cond.
* tree-ssanames.c (release_defs): Assert in_ssa_p.
* tree.c (upper_bound_in_type, lower_bound_in_type): Rewrite.
2005-07-08 Andrew Pinski <pinskia@physics.uc.edu>
PR tree-opt/22356

View File

@ -1,3 +1,8 @@
2005-07-08 Kazu Hirata <kazu@codesourcery.com>
PR tree-optimization/20139
* gcc.dg/tree-ssa/pr20139.c: New.
2005-07-08 Andrew Pinski <pinskia@physics.uc.edu>
PR tree-opt/22356

View File

@ -0,0 +1,23 @@
/* PR tree-optimization/20139
This testcase is derived from gcc.dg/20020720-1.c. Here we check
that the optimization happens at tree level. */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-final_cleanup" } */
extern double fabs (double);
extern void link_error (void);
void
foo (double x)
{
double p, q;
p = fabs (x);
q = 0.0;
if (p < q)
link_error ();
}
/* { dg-final { scan-tree-dump-times "link_error" 0 "final_cleanup" } } */
/* { dg-final { cleanup-tree-dump "final_cleanup" } } */

View File

@ -1981,7 +1981,12 @@ remove_bb (basic_block bb)
}
else
{
release_defs (stmt);
/* Release SSA definitions if we are in SSA. Note that we
may be called when not in SSA. For example,
final_cleanup calls this function via
cleanup_tree_cfg. */
if (in_ssa_p)
release_defs (stmt);
bsi_remove (&i);
}

View File

@ -132,6 +132,7 @@ struct tree_opt_pass pass_cleanup_cfg =
static void
execute_cleanup_cfg_post_optimizing (void)
{
fold_cond_expr_cond ();
cleanup_tree_cfg ();
cleanup_dead_labels ();
group_case_labels ();

View File

@ -289,6 +289,10 @@ release_defs (tree stmt)
tree def;
ssa_op_iter iter;
/* Make sure that we are in SSA. Otherwise, operand cache may point
to garbage. */
gcc_assert (in_ssa_p);
FOR_EACH_SSA_TREE_OPERAND (def, stmt, iter, SSA_OP_ALL_DEFS)
if (TREE_CODE (def) == SSA_NAME)
release_ssa_name (def);