Commit ef23e6a2 by Richard Biener Committed by Richard Biener

re PR rtl-optimization/56921 (ICE in rtx_cost called by doloop_optimize_loops for PPC)

2013-04-17  Richard Biener  <rguenther@suse.de>

	PR rtl-optimization/56921
	* cfgloop.h (struct loop): Add simple_loop_desc member.
	(struct niter_desc): Mark with GTY(()).
	(simple_loop_desc): Do not use aux field but simple_loop_desc.
	* loop-iv.c (get_simple_loop_desc): Likewise.
	(free_simple_loop_desc): Likewise.

	Revert
	2013-04-16  Richard Biener  <rguenther@suse.de>

	PR rtl-optimization/56921
	* loop-init.c (pass_rtl_move_loop_invariants): Add
	TODO_do_not_ggc_collect to todo_flags_finish.
	(pass_rtl_unswitch): Same.
	(pass_rtl_unroll_and_peel_loops): Same.
	(pass_rtl_doloop): Same.

From-SVN: r198025
parent fc6f94f5
2013-04-17 Richard Biener <rguenther@suse.de>
PR rtl-optimization/56921
* cfgloop.h (struct loop): Add simple_loop_desc member.
(struct niter_desc): Mark with GTY(()).
(simple_loop_desc): Do not use aux field but simple_loop_desc.
* loop-iv.c (get_simple_loop_desc): Likewise.
(free_simple_loop_desc): Likewise.
Revert
2013-04-16 Richard Biener <rguenther@suse.de>
PR rtl-optimization/56921
* loop-init.c (pass_rtl_move_loop_invariants): Add
TODO_do_not_ggc_collect to todo_flags_finish.
(pass_rtl_unswitch): Same.
(pass_rtl_unroll_and_peel_loops): Same.
(pass_rtl_doloop): Same.
2013-04-17 Eric Botcazou <ebotcazou@adacore.com> 2013-04-17 Eric Botcazou <ebotcazou@adacore.com>
* tree-ssa-alias.c (nonoverlapping_component_refs_of_decl_p): New. * tree-ssa-alias.c (nonoverlapping_component_refs_of_decl_p): New.
......
...@@ -172,6 +172,9 @@ struct GTY ((chain_next ("%h.next"))) loop { ...@@ -172,6 +172,9 @@ struct GTY ((chain_next ("%h.next"))) loop {
/* Head of the cyclic list of the exits of the loop. */ /* Head of the cyclic list of the exits of the loop. */
struct loop_exit *exits; struct loop_exit *exits;
/* Number of iteration analysis data for RTL. */
struct niter_desc *simple_loop_desc;
}; };
/* Flags for state of loop structure. */ /* Flags for state of loop structure. */
...@@ -372,7 +375,7 @@ struct rtx_iv ...@@ -372,7 +375,7 @@ struct rtx_iv
/* The description of an exit from the loop and of the number of iterations /* The description of an exit from the loop and of the number of iterations
till we take the exit. */ till we take the exit. */
struct niter_desc struct GTY(()) niter_desc
{ {
/* The edge out of the loop. */ /* The edge out of the loop. */
edge out_edge; edge out_edge;
...@@ -425,7 +428,7 @@ extern void free_simple_loop_desc (struct loop *loop); ...@@ -425,7 +428,7 @@ extern void free_simple_loop_desc (struct loop *loop);
static inline struct niter_desc * static inline struct niter_desc *
simple_loop_desc (struct loop *loop) simple_loop_desc (struct loop *loop)
{ {
return (struct niter_desc *) loop->aux; return loop->simple_loop_desc;
} }
/* Accessors for the loop structures. */ /* Accessors for the loop structures. */
......
...@@ -434,8 +434,7 @@ struct rtl_opt_pass pass_rtl_move_loop_invariants = ...@@ -434,8 +434,7 @@ struct rtl_opt_pass pass_rtl_move_loop_invariants =
0, /* properties_destroyed */ 0, /* properties_destroyed */
0, /* todo_flags_start */ 0, /* todo_flags_start */
TODO_df_verify | TODO_df_verify |
TODO_df_finish | TODO_verify_rtl_sharing TODO_df_finish | TODO_verify_rtl_sharing /* todo_flags_finish */
| TODO_do_not_ggc_collect /* todo_flags_finish */
} }
}; };
...@@ -471,8 +470,7 @@ struct rtl_opt_pass pass_rtl_unswitch = ...@@ -471,8 +470,7 @@ struct rtl_opt_pass pass_rtl_unswitch =
0, /* properties_provided */ 0, /* properties_provided */
0, /* properties_destroyed */ 0, /* properties_destroyed */
0, /* todo_flags_start */ 0, /* todo_flags_start */
TODO_verify_rtl_sharing TODO_verify_rtl_sharing, /* todo_flags_finish */
| TODO_do_not_ggc_collect /* todo_flags_finish */
} }
}; };
...@@ -521,8 +519,7 @@ struct rtl_opt_pass pass_rtl_unroll_and_peel_loops = ...@@ -521,8 +519,7 @@ struct rtl_opt_pass pass_rtl_unroll_and_peel_loops =
0, /* properties_provided */ 0, /* properties_provided */
0, /* properties_destroyed */ 0, /* properties_destroyed */
0, /* todo_flags_start */ 0, /* todo_flags_start */
TODO_verify_rtl_sharing TODO_verify_rtl_sharing, /* todo_flags_finish */
| TODO_do_not_ggc_collect /* todo_flags_finish */
} }
}; };
...@@ -564,7 +561,6 @@ struct rtl_opt_pass pass_rtl_doloop = ...@@ -564,7 +561,6 @@ struct rtl_opt_pass pass_rtl_doloop =
0, /* properties_provided */ 0, /* properties_provided */
0, /* properties_destroyed */ 0, /* properties_destroyed */
0, /* todo_flags_start */ 0, /* todo_flags_start */
TODO_verify_rtl_sharing TODO_verify_rtl_sharing /* todo_flags_finish */
| TODO_do_not_ggc_collect /* todo_flags_finish */
} }
}; };
...@@ -3016,10 +3016,10 @@ get_simple_loop_desc (struct loop *loop) ...@@ -3016,10 +3016,10 @@ get_simple_loop_desc (struct loop *loop)
/* At least desc->infinite is not always initialized by /* At least desc->infinite is not always initialized by
find_simple_loop_exit. */ find_simple_loop_exit. */
desc = XCNEW (struct niter_desc); desc = ggc_alloc_cleared_niter_desc ();
iv_analysis_loop_init (loop); iv_analysis_loop_init (loop);
find_simple_exit (loop, desc); find_simple_exit (loop, desc);
loop->aux = desc; loop->simple_loop_desc = desc;
if (desc->simple_p && (desc->assumptions || desc->infinite)) if (desc->simple_p && (desc->assumptions || desc->infinite))
{ {
...@@ -3069,6 +3069,6 @@ free_simple_loop_desc (struct loop *loop) ...@@ -3069,6 +3069,6 @@ free_simple_loop_desc (struct loop *loop)
if (!desc) if (!desc)
return; return;
free (desc); ggc_free (desc);
loop->aux = NULL; loop->simple_loop_desc = NULL;
} }
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