This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] PR 11591: Allow any offset to arg-pointer in nonstrict case
- From: Hartmut Penner <HPENNER at de dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org, Geoff Keating <geoffk at geoffk dot org>, Aldy Hernandez <aldyh at redhat dot com>, dje at watson dot ibm dot com, Segher Boessenkool <BOESSEN at de dot ibm dot com>, maissner at suse dot de, Andreas Jaeger <aj at suse dot de>, Michael Matz <matz at suse dot cz>
- Date: Mon, 29 Mar 2004 11:43:05 +0200
- Subject: [PATCH] PR 11591: Allow any offset to arg-pointer in nonstrict case
Hi,
altivec-5.c fails on 3.4 and mainline branch for ppc 32 bit.
In the early phase of the compilation of altivec-5.c, following code is
generated:
g(insn 5 19 6 0 (nil) (set (reg/v:V4SI 120 [ b ])
(mem/f:V4SI (reg/f:SI 113 virtual-incoming-args) [4 b+0 S16 A128])) -1 (nil)
(nil))
This is shortly after transformed to an offset to the argument pointer.
(insn 5 19 6 0 (nil) (set (reg/v:V4SI 120 [ b ])
(mem/f:V4SI (plus:SI (reg/f:SI 67 ap)
(const_int 8 [0x8])) [4 b+0 S16 A128])) -1 (nil)
(nil))
Because this is not a valid address, as displacement is not a multiple of 16,
we get ICE for an unrecognizable insn.
Since 'ap' is only a virtual register, which is replaced with an offset to the
stack pointer later on anyway, we should accept this as valid address.
This is analogous to allowing any offset to virtual_stack_vars_rtx in the
nonstrict case in rs6000_legitimate_address.
Bootstrapped / regtested for ppc32 & ppc64 linux.
OK to commit to Mainline / gcc-3.4 ?
regards, Hartmut
ChangeLog:
* config/rs6000/rs6000.c (rs6000_legitimate_address):
Allow any offset to argument pointer in non-strict case.
Index: gcc/config/rs6000/rs6000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.616
diff -u -p -r1.616 rs6000.c
--- gcc/config/rs6000/rs6000.c 25 Mar 2004 17:43:19 -0000 1.616
+++ gcc/config/rs6000/rs6000.c 29 Mar 2004 07:39:05 -0000
@@ -3267,7 +3267,8 @@ rs6000_legitimate_address (enum machine_
if (! reg_ok_strict
&& GET_CODE (x) == PLUS
&& GET_CODE (XEXP (x, 0)) == REG
- && XEXP (x, 0) == virtual_stack_vars_rtx
+ && (XEXP (x, 0) == virtual_stack_vars_rtx
+ || XEXP (x, 0) == arg_pointer_rtx)
&& GET_CODE (XEXP (x, 1)) == CONST_INT)
return 1;
if (legitimate_offset_address_p (mode, x, reg_ok_strict))