This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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))



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]