diff options
author | Richard Biener <rguenther@suse.de> | 2019-03-25 12:18:38 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2019-03-25 12:18:38 +0000 |
commit | c0eb90b5db85f59f031a827755a978772072f44d (patch) | |
tree | 61b057d5f4ad0f2c138811add99361726b86a67b | |
parent | ecef0d345848dedec252f86f6d528c0536b30e69 (diff) | |
download | gcc-c0eb90b5db85f59f031a827755a978772072f44d.zip gcc-c0eb90b5db85f59f031a827755a978772072f44d.tar.gz gcc-c0eb90b5db85f59f031a827755a978772072f44d.tar.bz2 |
re PR middle-end/89779 (internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in tree_nop_conversion_p, at tree.c:12798)
2019-03-25 Richard Biener <rguenther@suse.de>
PR tree-optimization/89779
* tree-ssa-loop-ivopts.c (remove_unused_ivs): Return
to remove IV defs, delay actual removal.
(tree_ssa_iv_optimize_loop): Likewise. Avoid SCEV reset.
(tree_ssa_iv_optimize): Remove eliminated IV defs at the
very end, properly also reset loop control IV information.
From-SVN: r269914
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/tree-ssa-loop-ivopts.c | 30 |
2 files changed, 25 insertions, 14 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e7fbaeb..0a93882d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,14 @@ 2019-03-25 Richard Biener <rguenther@suse.de> + PR tree-optimization/89779 + * tree-ssa-loop-ivopts.c (remove_unused_ivs): Return + to remove IV defs, delay actual removal. + (tree_ssa_iv_optimize_loop): Likewise. Avoid SCEV reset. + (tree_ssa_iv_optimize): Remove eliminated IV defs at the + very end, properly also reset loop control IV information. + +2019-03-25 Richard Biener <rguenther@suse.de> + PR tree-optimization/89802 * tree-ssa-math-opts.c (convert_mult_to_fma_1): Properly move EH data to folded stmt. diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c index a44b4cb..a2b6b2b 100644 --- a/gcc/tree-ssa-loop-ivopts.c +++ b/gcc/tree-ssa-loop-ivopts.c @@ -7258,11 +7258,10 @@ rewrite_groups (struct ivopts_data *data) /* Removes the ivs that are not used after rewriting. */ static void -remove_unused_ivs (struct ivopts_data *data) +remove_unused_ivs (struct ivopts_data *data, bitmap toremove) { unsigned j; bitmap_iterator bi; - bitmap toremove = BITMAP_ALLOC (NULL); /* Figure out an order in which to release SSA DEFs so that we don't release something that we'd have to propagate into a debug stmt @@ -7384,10 +7383,6 @@ remove_unused_ivs (struct ivopts_data *data) } } } - - release_defs_bitset (toremove); - - BITMAP_FREE (toremove); } /* Frees memory occupied by struct tree_niter_desc in *VALUE. Callback @@ -7530,7 +7525,8 @@ loop_body_includes_call (basic_block *body, unsigned num_nodes) /* Optimizes the LOOP. Returns true if anything changed. */ static bool -tree_ssa_iv_optimize_loop (struct ivopts_data *data, struct loop *loop) +tree_ssa_iv_optimize_loop (struct ivopts_data *data, struct loop *loop, + bitmap toremove) { bool changed = false; struct iv_ca *iv_ca; @@ -7600,12 +7596,7 @@ tree_ssa_iv_optimize_loop (struct ivopts_data *data, struct loop *loop) rewrite_groups (data); /* Remove the ivs that are unused after rewriting. */ - remove_unused_ivs (data); - - /* We have changed the structure of induction variables; it might happen - that definitions in the scev database refer to some of them that were - eliminated. */ - scev_reset (); + remove_unused_ivs (data, toremove); finish: free_loop_data (data); @@ -7620,6 +7611,7 @@ tree_ssa_iv_optimize (void) { struct loop *loop; struct ivopts_data data; + auto_bitmap toremove; tree_ssa_iv_optimize_init (&data); @@ -7629,9 +7621,19 @@ tree_ssa_iv_optimize (void) if (dump_file && (dump_flags & TDF_DETAILS)) flow_loop_dump (loop, dump_file, NULL, 1); - tree_ssa_iv_optimize_loop (&data, loop); + tree_ssa_iv_optimize_loop (&data, loop, toremove); } + /* Remove eliminated IV defs. */ + release_defs_bitset (toremove); + + /* We have changed the structure of induction variables; it might happen + that definitions in the scev database refer to some of them that were + eliminated. */ + scev_reset_htab (); + /* Likewise niter and control-IV information. */ + free_numbers_of_iterations_estimates (cfun); + tree_ssa_iv_optimize_finalize (&data); } |