diff mbox

Guard pass_chkp_instrumentation_passes with flag_check_pointer_bounds

Message ID alpine.LSU.2.11.1503251302190.15299@zhemvz.fhfr.qr
State New
Headers show

Commit Message

Richard Biener March 25, 2015, 12:03 p.m. UTC
Avoids a fixup-cfg and cgraph edge rebuild.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.

Richard.

2015-03-25  Richard Biener  <rguenther@suse.de>

	* passes.c (pass_manager::execute_early_local_passes): Guard
	execution of pass_chkp_instrumentation_passes with
	flag_check_pointer_bounds.
	(pass_chkp_instrumentation_passes::gate): Likewise.
diff mbox

Patch

Index: gcc/passes.c
===================================================================
--- gcc/passes.c	(revision 221633)
+++ gcc/passes.c	(working copy)
@@ -156,7 +156,8 @@  void
 pass_manager::execute_early_local_passes ()
 {
   execute_pass_list (cfun, pass_build_ssa_passes_1->sub);
-  execute_pass_list (cfun, pass_chkp_instrumentation_passes_1->sub);
+  if (flag_check_pointer_bounds)
+    execute_pass_list (cfun, pass_chkp_instrumentation_passes_1->sub);
   execute_pass_list (cfun, pass_local_optimization_passes_1->sub);
 }
 
@@ -424,7 +425,8 @@  public:
   virtual bool gate (function *)
     {
       /* Don't bother doing anything if the program has errors.  */
-      return (!seen_error () && !in_lto_p);
+      return (flag_check_pointer_bounds
+	      && !seen_error () && !in_lto_p);
     }
 
 }; // class pass_chkp_instrumentation_passes