PATCH: Remove unscaled index insn hack from pa.c
John David Anglin
dave@hiauly1.hia.nrc.ca
Sun Dec 17 16:15:00 GMT 2000
Now that the pa1.1 port under hpux 10.20 is solid again, I ran a bootstrap
check with the cleanup to basereg_operand suggested by Jeff. The source
is Sept. 16 CVS plus this patch and the two patches reported in this
message: < http://gcc.gnu.org/ml/gcc-patches/2000-12/msg00851.html >.
The test results are here:
< http://gcc.gnu.org/ml/gcc-testresults/2000-12/msg00184.html >. There are
4 regressions in the g++ testsuite relative to the results on the 15th
without the patch but I think these are related to changes in the testsuite.
There is no change in any of the other testsuites.
Please review and install if ok.
> 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.
Dave
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
2000-11-30 John David Anglin <dave@hiauly1.hia.nrc.ca>
From Jeff Law.
* pa.c (basereg_operand): Simplify.
--- pa.c.save Thu Nov 30 17:43:15 2000
+++ pa.c Thu Nov 30 17:50:19 2000
@@ -6152,29 +6152,15 @@
if (TARGET_NO_SPACE_REGS)
return (GET_CODE (op) == REG);
- /* 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));
+ && REG_POINTER (op)
+ && register_operand (op, mode));
}
/* Return 1 if this operand is anything other than a hard register. */
More information about the Gcc-patches
mailing list