diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2019-09-30 16:20:41 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2019-09-30 16:20:41 +0000 |
commit | c1b582720a39c3cb944aaff0298f721cdd034e3f (patch) | |
tree | 29a3346655262eb6b17660d9c0a6ef6e1d3103a5 /gcc | |
parent | 1849569621d13c9c070c555f9463ad289afb8416 (diff) | |
download | gcc-c1b582720a39c3cb944aaff0298f721cdd034e3f.zip gcc-c1b582720a39c3cb944aaff0298f721cdd034e3f.tar.gz gcc-c1b582720a39c3cb944aaff0298f721cdd034e3f.tar.bz2 |
Remove global call sets: function.c
Whatever the rights and wrongs of the way aggregate_value_p
handles call-preserved registers, it's a de facto part of the ABI,
so we shouldn't change it. The patch simply extends the current
approach to whatever call-preserved set the function happens to
be using.
2019-09-30 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* function.c (aggregate_value_p): Work out which ABI the
function is using before testing which registers are at least
partly preserved by a call.
From-SVN: r276322
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/function.c | 9 |
2 files changed, 14 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 138f3f0..9d8b083 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2019-09-30 Richard Sandiford <richard.sandiford@arm.com> + * function.c (aggregate_value_p): Work out which ABI the + function is using before testing which registers are at least + partly preserved by a call. + +2019-09-30 Richard Sandiford <richard.sandiford@arm.com> + * early-remat.c: Include regs.h and function-abi.h. (early_remat::maybe_add_candidate): Don't check for call-clobbered registers here. diff --git a/gcc/function.c b/gcc/function.c index c3aa6a5..a1c76a4 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -2120,10 +2120,17 @@ aggregate_value_p (const_tree exp, const_tree fntype) if (!REG_P (reg)) return 0; + /* Use the default ABI if the type of the function isn't known. + The scheme for handling interoperability between different ABIs + requires us to be able to tell when we're calling a function with + a nondefault ABI. */ + const predefined_function_abi &abi = (fntype + ? fntype_abi (fntype) + : default_function_abi); regno = REGNO (reg); nregs = hard_regno_nregs (regno, TYPE_MODE (type)); for (i = 0; i < nregs; i++) - if (! call_used_or_fixed_reg_p (regno + i)) + if (!fixed_regs[regno + i] && !abi.clobbers_full_reg_p (regno + i)) return 1; return 0; |