This is the mail archive of the 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]

Re: [PATCH] Add named address support to GCC 4.5

> Are these patches ok to apply?

I noticed that you created


which are a nice improvement over GO_IF_LEGITIMATE_ADDRESS. :-)

What about allowing targets to implement just

 TARGET_LEGITIMATE_ADDRESS_P (x, mode, strict, as)
 TARGET_LEGITIMIZE_ADDRESS (x, oldx, mode, as)

to do so if they implement address spaces)?  Many targets would be
almost ready for the change and spu is one of them, so this would not be
a big change.

BTW, I have an incomplete patch lying around to hookize
LEGITIMIZE_ADDRESS and I found it simpler to convert targets if the call
looks like this in memory_address:

        rtx orig_x = x;
        x = targetm.legitimize_address (x, oldx, mode);
        if (orig_x != x && memory_address_p (mode, x))
          goto done;
        x = orig_x;

it would be nice if this convention would be adopted for
TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS, just in case I ever finish the
patch. ;-)

The change to spu_legitimize_address would simply be

Index: config/spu/spu.c
--- config/spu/spu.c    (revision 144857)
+++ config/spu/spu.c    (working copy)
@@ -3572,10 +3572,8 @@ spu_legitimize_address (rtx x, rtx oldx
       else if (GET_CODE (op1) != REG)
        op1 = force_reg (Pmode, op1);
       x = gen_rtx_PLUS (Pmode, op0, op1);
-      if (spu_legitimate_address (mode, x, 0))
-       return x;
-  return NULL_RTX;
+  return x;

 /* Handle an attribute requiring a FUNCTION_DECL; arguments as in

(BTW, I guess you'll get faster review if you split the patch in C,
middle-end, and spu parts).


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