diff mbox

[gomp4,13/23] Slightly change postreload passes

Message ID 52A5DC7B.5090201@codesourcery.com
State New
Headers show

Commit Message

Bernd Schmidt Dec. 9, 2013, 3:06 p.m. UTC
To be used together with the no_register_allocation hook.

Comments

Jakub Jelinek Dec. 9, 2013, 3:37 p.m. UTC | #1
On Mon, Dec 09, 2013 at 04:06:35PM +0100, Bernd Schmidt wrote:
> Everything after register allocation is currently in pass_postreload
> rather than pass_rest_of_compilation. This seems arbitrary to me, and
> for a target that doesn't do register allocation, pass_postreload isn't
> run, so the very last few passes (at least reorg and final) need to be
> moved up a level.

I think the main reason for doing it that way was that we don't run the
late passes if register allocation fails, they might be confused by it.
E.g. if the source contains some inline asm that can't be reloaded.
Your patch might cause ICEs for that.
Can't you make those passes a subpass of some new pass and just gate
it on no errors or something similar?
> 
> 	gcc/
> 	* passes.def (pass_compute_alignments, pass_duplicate_computed_gotos,
> 	pass_variable_tracking, pass_free_cfg, pass_machine_reorg,
> 	pass_cleanup_barriers, pass_delay_slots,
> 	pass_split_for_shorten_branches, pass_convert_to_eh_region_ranges,
> 	pass_shorten_branches, pass_est_nothrow_function_flags,
> 	pass_dwarf2_frame, pass_final): Move outside of pass_postreload and
> 	into pass_rest_of_compilation.

	Jakub
diff mbox

Patch

Everything after register allocation is currently in pass_postreload
rather than pass_rest_of_compilation. This seems arbitrary to me, and
for a target that doesn't do register allocation, pass_postreload isn't
run, so the very last few passes (at least reorg and final) need to be
moved up a level.

	gcc/
	* passes.def (pass_compute_alignments, pass_duplicate_computed_gotos,
	pass_variable_tracking, pass_free_cfg, pass_machine_reorg,
	pass_cleanup_barriers, pass_delay_slots,
	pass_split_for_shorten_branches, pass_convert_to_eh_region_ranges,
	pass_shorten_branches, pass_est_nothrow_function_flags,
	pass_dwarf2_frame, pass_final): Move outside of pass_postreload and
	into pass_rest_of_compilation.

------------------------------------------------------------------------
Index: gcc/passes.def
===================================================================
--- gcc/passes.def.orig
+++ gcc/passes.def
@@ -396,19 +396,19 @@  along with GCC; see the file COPYING3.
 	      NEXT_PASS (pass_split_before_regstack);
 	      NEXT_PASS (pass_stack_regs_run);
 	  POP_INSERT_PASSES ()
-	  NEXT_PASS (pass_compute_alignments);
-	  NEXT_PASS (pass_variable_tracking);
-	  NEXT_PASS (pass_free_cfg);
-	  NEXT_PASS (pass_machine_reorg);
-	  NEXT_PASS (pass_cleanup_barriers);
-	  NEXT_PASS (pass_delay_slots);
-	  NEXT_PASS (pass_split_for_shorten_branches);
-	  NEXT_PASS (pass_convert_to_eh_region_ranges);
-	  NEXT_PASS (pass_shorten_branches);
-	  NEXT_PASS (pass_set_nothrow_function_flags);
-	  NEXT_PASS (pass_dwarf2_frame);
-	  NEXT_PASS (pass_final);
       POP_INSERT_PASSES ()
+      NEXT_PASS (pass_compute_alignments);
+      NEXT_PASS (pass_variable_tracking);
+      NEXT_PASS (pass_free_cfg);
+      NEXT_PASS (pass_machine_reorg);
+      NEXT_PASS (pass_cleanup_barriers);
+      NEXT_PASS (pass_delay_slots);
+      NEXT_PASS (pass_split_for_shorten_branches);
+      NEXT_PASS (pass_convert_to_eh_region_ranges);
+      NEXT_PASS (pass_shorten_branches);
+      NEXT_PASS (pass_set_nothrow_function_flags);
+      NEXT_PASS (pass_dwarf2_frame);
+      NEXT_PASS (pass_final);
       NEXT_PASS (pass_df_finish);
   POP_INSERT_PASSES ()
   NEXT_PASS (pass_clean_state);