This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: fix PR40952: promote_decl_mode has wrong semantics on POINTERS_EXTEND machines
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Paolo Bonzini <bonzini at gnu dot org>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Richard Sandiford <rdsandiford at googlemail dot com>
- Date: Wed, 12 Aug 2009 13:16:18 +0200
- Subject: Re: fix PR40952: promote_decl_mode has wrong semantics on POINTERS_EXTEND machines
- References: <4A829AF3.7000607@gnu.org>
On Wed, Aug 12, 2009 at 12:35 PM, Paolo Bonzini<bonzini@gnu.org> wrote:
> This fixes a failure on ia64-hpux, which has 32-bit pointers and 64-bit
> addresses.
>
> The reason of the failure is that on these machines the pointers are always
> extended to Pmode as soon as they're copied from the incoming hard register
> to a pseudo. ?In this case, promote_decl_mode should return Pmode (and the
> appropriate signed/unsigned value) for PARM_DECL and RESULT_DECL trees.
>
> To achieve this, I added a third mode to the promote_function_mode hook,
> which is what promote_decl_mode should use. ?At the same time, when emitting
> the copy out from the RESULT_DECL to the return value hard register I have
> to use promote_function_mode instead of promote_decl_mode.
>
> The patch also fixes a typo in calls.c.
>
> I'll rename for_return and add an enum for it in a follow-up early next
> week. ?I posted this now because of Richard's patch that introduces a new
> use of promote_decl_mode. ?Richard, I would like to commit this first if it
> is not a problem for you.
>
> Tested C/Fortran on hppa-hpux, all languages on ia64-hpux (both by Steve
> Ellcey). ?Bootstrap/regtest on x86_64-linux in progress.
>
> Ok?
Ok if the bootstrap / regtest passes.
Thanks,
Richard.
> Paolo
>