From 49a5e4e6e433dc206e05833d83d5edb41fe0ddec Mon Sep 17 00:00:00 2001 From: florian Date: Wed, 6 Nov 2013 21:10:26 +0000 Subject: + dead store elimination, based on a patch by Jeppe Johansen git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@25962 3ad0048d-3df7-0310-abae-a5850022a9f2 --- compiler/psub.pas | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'compiler/psub.pas') diff --git a/compiler/psub.pas b/compiler/psub.pas index cff7e15312..e09701c8d2 100644 --- a/compiler/psub.pas +++ b/compiler/psub.pas @@ -115,7 +115,8 @@ implementation opttail, optcse, optloop, - optconstprop + optconstprop, + optdeadstore {$if defined(arm) or defined(avr) or defined(fpc_compiler_has_fixup_jmps)} ,aasmcpu {$endif arm} @@ -1253,7 +1254,7 @@ implementation (pi_is_recursive in flags) then do_opttail(code,procdef); - if (cs_opt_constant_propagate in current_settings.optimizerswitches) then + if cs_opt_constant_propagate in current_settings.optimizerswitches then do_optconstpropagate(code); if (cs_opt_nodedfa in current_settings.optimizerswitches) and @@ -1293,6 +1294,9 @@ implementation include(flags,pi_dfaavailable); end; + if (pi_dfaavailable in flags) and (cs_opt_dead_store_eliminate in current_settings.optimizerswitches) then + do_optdeadstoreelim(code); + if (cs_opt_loopstrength in current_settings.optimizerswitches) { our induction variable strength reduction doesn't like for loops with more than one entry } -- cgit v1.2.1