This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: Remove unscaled index insn hack from pa.c
- To: law at redhat dot com
- Subject: Re: PATCH: Remove unscaled index insn hack from pa.c
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- Date: Thu, 30 Nov 2000 13:46:53 -0500 (EST)
- Cc: gcc-patches at gcc dot gnu dot org
> If you're looking for further cleanup work I think we can simplify
> basereg_operand now.
>
> This hunk of code:
>
> /* Once reload has started any register with REG_POINTER set
> is considered valid. Reload should only create indexed addresses
> using the stack/frame pointer. All others are checked for
> validity when they are created by the combine pass. */
> if (reload_in_progress || reload_completed)
> return (GET_CODE (op) == REG && REG_POINTER (op));
>
> /* Stack is always OK for indexing. */
> if (op == stack_pointer_rtx)
> return 1;
>
> /* While it's always safe to index off the frame pointer, it's not
> always profitable, particularly when the frame pointer is being
> eliminated. */
> if (! flag_omit_frame_pointer && op == frame_pointer_rtx)
> return 1;
>
> /* The only other valid OPs are pseudo registers with
> REG_POINTER set. */
> return (GET_CODE (op) == REG
> && REGNO (op) >= FIRST_PSEUDO_REGISTER
> && register_operand (op, mode)
> && REG_POINTER (op));
>
> I think can just turn into:
>
> /* While it's always safe to index off the frame pointer, it's not
> always profitable, particularly when the frame pointer is being
> eliminated. */
> if (! flag_omit_frame_pointer && op == frame_pointer_rtx)
> return 1;
>
> return (GET_CODE (op) == REG
> && REG_POINTER (op)
> && register_operand (op, mode));
>
>
> But I haven't actually tried it.
>
> The general idea being that we can accept any register that is a pointer
> (and which is valid for MODE). We kick out the frame pointer in certain
> cases for the sake of optimization.
Will try today.
Dave
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)