Move objsz pass for -Og

Submitted by Richard Guenther on Sept. 19, 2012, 1:29 p.m.


Message ID alpine.LNX.2.00.1209191528040.28649@zhemvz.fhfr.qr
State New
Headers show

Commit Message

Richard Guenther Sept. 19, 2012, 1:29 p.m.
This moves objsz so basic constant propagation (done by copyprop)
propagates its results before we fold the builtins in fab.  This
fixes execute fails in the builtins testsuite.

Bootstrapped on x86_64-unknown-linux-gnu, full testing in progress.


2012-09-19  Richard Guenther  <>

	* passes.c (init_optimization_passes): For -Og move
	pass_object_sizes inbetween CCP and copyprop.

Patch hide | download patch | download mbox

Index: gcc/passes.c
--- gcc/passes.c	(revision 191466)
+++ gcc/passes.c	(working copy)
@@ -1528,11 +1528,13 @@  init_optimization_passes (void)
       NEXT_PASS (pass_lower_vector_ssa);
       /* Perform simple scalar cleanup which is constant/copy propagation.  */
       NEXT_PASS (pass_ccp);
+      NEXT_PASS (pass_object_sizes);
+      /* Copy propagation also copy-propagates constants, this is necessary
+         to forward object-size results properly.  */
       NEXT_PASS (pass_copy_prop);
       NEXT_PASS (pass_rename_ssa_copies);
       NEXT_PASS (pass_dce);
       /* Fold remaining builtins.  */
-      NEXT_PASS (pass_object_sizes);
       NEXT_PASS (pass_fold_builtins);
       /* ???  We do want some kind of loop invariant motion, but we possibly
          need to adjust LIM to be more friendly towards preserving accurate