From: Richard Sandiford Date: Mon, 30 Sep 2019 16:20:15 +0000 (+0000) Subject: Remove global call sets: cfgloopanal.c X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=43b484fbf281553353c6ef55ff0871b222579004;p=gcc.git Remove global call sets: cfgloopanal.c ...or rather, make the use of the default ABI explicit. That seems OK if not ideal for this heuristic. In practical terms, the code patched here is counting GENERAL_REGS, which are treated in the same way by all concurrent ABI variants on AArch64. It might give bad results if used for interrupt handlers though. 2019-09-30 Richard Sandiford gcc/ * cfgloopanal.c: Include regs.h and function-abi.h. (init_set_costs): Use default_function_abi to test whether a general register is call-clobbered. From-SVN: r276315 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a3e4ff24c8d..6b08d70e11c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-09-30 Richard Sandiford + + * cfgloopanal.c: Include regs.h and function-abi.h. + (init_set_costs): Use default_function_abi to test whether + a general register is call-clobbered. + 2019-09-30 Richard Sandiford * cfgcleanup.c (old_insns_match_p): Compare the ABIs of calls diff --git a/gcc/cfgloopanal.c b/gcc/cfgloopanal.c index 0ebecc37ad8..95ec929c7bd 100644 --- a/gcc/cfgloopanal.c +++ b/gcc/cfgloopanal.c @@ -32,6 +32,8 @@ along with GCC; see the file COPYING3. If not see #include "graphds.h" #include "params.h" #include "sreal.h" +#include "regs.h" +#include "function-abi.h" struct target_cfgloop default_target_cfgloop; #if SWITCHABLE_TARGET @@ -353,7 +355,10 @@ init_set_costs (void) && !fixed_regs[i]) { target_avail_regs++; - if (call_used_or_fixed_reg_p (i)) + /* ??? This is only a rough heuristic. It doesn't cope well + with alternative ABIs, but that's an optimization rather than + correctness issue. */ + if (default_function_abi.clobbers_full_reg_p (i)) target_clobbered_regs++; }