This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] rs6000: Fix TARGET_PROMOTE_FUNCTION_MODE
- From: David Edelsohn <dje dot gcc at gmail dot com>
- To: Segher Boessenkool <segher at kernel dot crashing dot org>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 9 Jan 2015 11:47:10 -0500
- Subject: Re: [PATCH] rs6000: Fix TARGET_PROMOTE_FUNCTION_MODE
- Authentication-results: sourceware.org; auth=none
- References: <be73b77b16d2abd6c9194b873fd27efe8c8e4dfe dot 1420765404 dot git dot segher at kernel dot crashing dot org>
On Thu, Jan 8, 2015 at 8:10 PM, Segher Boessenkool
<segher@kernel.crashing.org> wrote:
> As the existing comment explains, we should always promote function
> arguments and return values. However, notwithstanding its name,
> default_promote_function_mode_always_promote does not always promote.
> Importantly, it does not for libcalls. This makes ftrapv-[12].c fail
> with 64-bit ABIs.
>
> This patch introduces an rs6000_promote_function_mode that _does_
> always promote, fixing this.
>
> Tested as usual (c,c++,fortran,ada; -m32,-m32/-mpowerpc64,-m64,-m64/-mlra).
> Is this okay for mainline?
>
>
> Segher
>
>
> 2015-01-08 Segher Boessenkool <segher@kernel.crashing.org>
>
> gcc/
> * config/rs6000/rs6000.c (TARGET_PROMOTE_FUNCTION_MODE): Implement
> as rs6000_promote_function_mode. Move comment to there.
> (rs6000_promote_function_mode): New function.
rs6000_promote_function_mode should use the PROMOTE_MODE macro. I
think that the macro has a bug for -m32 -mpowerpc64 in its use of
UNITS_PER_WORD. But I prefer one definition of the behavior to avoid
divergence.
Thanks David