Hi,

After moving the expansion of va_arg from gimplification to pass_stdarg, we execute less optimization passes on the expanded va_arg.

For example, in PR65893 the optimized-dump code for a va_arg expansion for aarch64 is less optimal than it was before, because pass_tree_ifcombine is no longer executed for the expanded va_arg.

This patch fixes the problem by moving pass_stdarg a bit earlier, to after 
pass_dce:
...
       NEXT_PASS (pass_vrp);
       NEXT_PASS (pass_chkp_opt);
       NEXT_PASS (pass_dce);
+      NEXT_PASS (pass_stdarg);
       NEXT_PASS (pass_call_cdce);
       NEXT_PASS (pass_cselim);
       NEXT_PASS (pass_copy_prop);
       NEXT_PASS (pass_tree_ifcombine);
       NEXT_PASS (pass_phiopt);
       NEXT_PASS (pass_tail_recursion);
       NEXT_PASS (pass_ch);
-      NEXT_PASS (pass_stdarg);
       NEXT_PASS (pass_lower_complex);
       NEXT_PASS (pass_sra);
       NEXT_PASS (pass_rename_ssa_copies);
...

Bootstrapped and reg-tested on x86_64.

OK for trunk?

Thanks,
- Tom
Move pass_stdarg to after pass_dce in pass_all_optimizations

2015-04-29  Tom de Vries  <t...@codesourcery.com>

	PR tree-optimization/65893
	* passes.def (pass_all_optimizations): Move pass_stdarg to after
	pass_dce.
---
 gcc/passes.def | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/passes.def b/gcc/passes.def
index 6dce141..32213e8 100644
--- a/gcc/passes.def
+++ b/gcc/passes.def
@@ -172,6 +172,7 @@ along with GCC; see the file COPYING3.  If not see
       NEXT_PASS (pass_vrp);
       NEXT_PASS (pass_chkp_opt);
       NEXT_PASS (pass_dce);
+      NEXT_PASS (pass_stdarg);
       NEXT_PASS (pass_call_cdce);
       NEXT_PASS (pass_cselim);
       NEXT_PASS (pass_copy_prop);
@@ -179,7 +180,6 @@ along with GCC; see the file COPYING3.  If not see
       NEXT_PASS (pass_phiopt);
       NEXT_PASS (pass_tail_recursion);
       NEXT_PASS (pass_ch);
-      NEXT_PASS (pass_stdarg);
       NEXT_PASS (pass_lower_complex);
       NEXT_PASS (pass_sra);
       NEXT_PASS (pass_rename_ssa_copies);
-- 
1.9.1

Reply via email to