This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: arm_reload_in_hi fix
- To: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Subject: Re: arm_reload_in_hi fix
- From: Richard Earnshaw <rearnsha at arm dot com>
- Date: Wed, 14 Jun 2000 14:37:07 +0100
- Cc: gcc-patches at gcc dot gnu dot org
- Cc: rearnsha at arm dot com
- Organization: ARM Ltd.
- Reply-To: rearnsha at arm dot com
Joern,
You don't say which older release. But I assume it is older than the
change below.
For architecture 4 we don't need a secondary reload for this case.
Indeed, if you look at SECONDARY_INPUT_RELOAD_CLASS we see
/* If we need to load shorts byte-at-a-time, then we need a scratch. */
#define SECONDARY_INPUT_RELOAD_CLASS(CLASS, MODE, X) \
(TARGET_ARM ? \
(((MODE) == HImode && ! arm_arch4 && TARGET_MMU_TRAPS \
&& (GET_CODE (X) == MEM \
|| ((GET_CODE (X) == REG || GET_CODE (X) == SUBREG) \
&& true_regnum (X) == -1))) \
? GENERAL_REGS : NO_REGS) \
: THUMB_SECONDARY_INPUT_RELOAD_CLASS (CLASS, MODE, X))
That is, we reject a secondary reload for the architecture 4 case.
So I don't think your patch is necessary or correct.
Tue Aug 18 03:20:53 1998 Richard Earnshaw (rearnsha@arm.com)
* arm.h (SECONDARY_INPUT_RELOAD_CLASS): Return NO_REGS if compiling
for architecture v4.
Richard.
> arm_reload_in_hi currently doesn't handle auto-increment addresses
> correctly - it will blithely generate patterns like:
>
> (insn 75 73 76 (set (subreg:SI (reg:HI 5 r5) 0)
> (zero_extend:SI (mem:QI (plus:SI (pre_dec:SI (reg/v:SI 1 r1))
> (const_int 1))))) -1 (nil)
> (nil))
>
> The testcase I have only triggers this bug in an older release, yet as
> far as I can tell, there is still nothing in place to prevent the problem
> from occuring for some other source. FWIW, the pattern that got reloaded
> was mem-mem move made by combine, since the predicates of *movhi_insn_arch4
> allow this:
>
> (insn 40 39 42 (set (mem:HI (pre_inc:SI (reg/v:SI 31)))
> (mem:HI (pre_inc:SI (reg/v:SI 32)))) 194 {*movhi_insn_arch4} (nil)
> (expr_list:REG_INC (reg/v:SI 32)
> (expr_list:REG_INC (reg/v:SI 31)
> (nil))))
>
>
> Tue Jun 13 18:17:11 2000 J"orn Rennecke <amylaar@cygnus.co.uk>
>
> * arm.c (arm_reload_in_hi): Handle auto-increment addressing modes.
>