This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH/RFA] ARM MASK_RETURN_ADDR fix for mixed 26/32-bit
- From: Richard Earnshaw <rearnsha at cambridge dot arm dot com>
- To: Jason R Thorpe <thorpej at wasabisystems dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Richard dot Earnshaw at arm dot com
- Date: Thu, 05 Sep 2002 11:11:10 +0100
- Subject: Re: [PATCH/RFA] ARM MASK_RETURN_ADDR fix for mixed 26/32-bit
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
> This patch originates from Richard Earnshaw, and has been in use in
> NetBSD's 2.95.3-based compiler for some time.
>
> Background: NetBSD runs on 26-bit as well as 32-bit ARM systems. APCS26
> is not used on the 26-bit systems, rather they use the same ABI as the
> 32-bit systems.
>
> Problem: GCC generates the correct return address mask for 26-bit systems
> only if APCS26 is in use.
>
> Solution: This patch causes GCC to determine the 26/32-bit'ness of the
> system at run-time, and generate the appropriate return address mask.
> If APCS26 or an ARMv4-or-higher CPU is specified, the decision falls back
> to compile-time.
>
> Tested on arm-elf sim, no regressions. OK to commit?
The patch needs to be fixed to work with -mthumb before this can go in.
For that case it should always return ~0 (Since I think we need to
preserve the Thumb bit in this case).
R.