Ok, I wrongly read what this macro did. Sorry about that. I was looking at the i386 port and use of this variable and this code came up:
#ifdef REG_OK_STRICT #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \ do { \ if (legitimate_address_p ((MODE), (X), 1)) \ goto ADDR; \ } while (0) #else #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \ do { \ if (legitimate_address_p ((MODE), (X), 0)) \ goto ADDR; \ } while (0) #endif and : #define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) \ do { \ (X) = legitimize_address ((X), (OLDX), (MODE)); \ if (memory_address_p ((MODE), (X))) \ goto WIN; \ } while (0) It seems that I should do the same as them no for my solution. First implement the legitimate_address function and then probably define it in both macros. As for the target hook, we are using GCC 4.3.2 for the moment and, sadly, have not yet any plans to move forward to the latest version of GCC. Thanks again, Jc On Wed, Jun 10, 2009 at 10:29 AM, Dave Korn<dave.korn.cyg...@googlemail.com> wrote: > Jean Christophe Beyler wrote: >> I'll be looking into this but I thought that GO_IF_LEGITIMATE_ADDRESS >> is for branches ? > > No, absolutely not. GILA is a general filter that has overall control over > which forms of addressing modes used to address memory may be generated in > RTL. > > http://gcc.gnu.org/onlinedocs/gccint/Addressing-Modes.html > > Hmm, I must have been looking at a slightly outdated build of the docs; > according to that page it's been deprecated on HEAD in favour of the hook > TARGET_LEGITIMATE_ADDRESS_P. You'll need to check the particular sources > you're using, that must be a fairly recent change(*). > > > cheers, > DaveK > -- > (*) - Yes: it was changed in r.147534, around four weeks ago. > http://gcc.gnu.org/viewcvs?view=rev&revision=147534 > >