rtl indexed addressing mode question
Spundun Bhatt
spundun@ISI.EDU
Thu Nov 7 15:55:00 GMT 2002
Mike Stump wrote:
> On Wednesday, October 30, 2002, at 05:26 PM, Spundun Bhatt wrote:
>
>> I am porting gcc to a new architecture. I am using rs6000 config
>> files as template.
>> My question is,
>> my architecture doesnt support indexed addressing(ST R2,R3,R4) so I
>> wanted to remove this mode from the config.
>> I have located the GO_IF_LEGITIMATE_ADDRESS macro.. which in turn
>> calls macro LEGITIMATE_INDEXED_ADDRESS .
>> I am thinking of setting the later macro to 0 so it will not match
>> the indexed addressing mode. Now I am wondering if the gcc will auto
>> matically figureout that it has to add the 2 registers and then use
>> the base+immediate offsetting mode.. or I have to modify some other
>> macros too? Or if this is not the way.. then whats a good way of
>> doing what I have to do?
>
>
> Try it, see if it works! :-) I suspect that the compiler would
> otherwise seem to just work, if you tried it.
Thanx a lot for your reply
But it didnt work :((
The change I made is this.
------------------------------------------------------
/*
* Spundun: DIVA doesnot support indexed addressing mode.
* hoping that this change will automatically fix the issues
* TODO: Review Needed.
*/
#define LEGITIMATE_INDEXED_ADDRESS_P(X) 0
/*#define LEGITIMATE_INDEXED_ADDRESS_P(X) \
(GET_CODE (X) == PLUS \
&& GET_CODE (XEXP (X, 0)) == REG \
&& GET_CODE (XEXP (X, 1)) == REG \
&& ((REG_OK_FOR_BASE_P (XEXP (X, 0)) \
&& REG_OK_FOR_INDEX_P (XEXP (X, 1))) \
|| (REG_OK_FOR_BASE_P (XEXP (X, 1)) \
&& REG_OK_FOR_INDEX_P (XEXP (X, 0)))))*/
------------------------------------------------------
And I get this error
------------------------------------------------------
rain:[Thu:07][11:52am] func_cornerturn> ~/gcc-cross/gcc-cross.current -S
stx_func_transitive.c
stx_func_transitive.c: In function `main':
stx_func_transitive.c:242: Internal compiler error:
stx_func_transitive.c:242: internal error--unrecognizable insn:
(insn 73 72 76 (set (mem/s:SI (plus:SI (reg:SI 126)
(reg:SI 125)) 0)
(reg:SI 127)) -1 (nil)
(nil))
rain:[Thu:07][12:09pm] func_cornerturn>
------------------------------------------------------
Should I try and play with the macro LEGITIMIZE_ADDRESS ? Or theres
something else I have to change?
Thanx
Spundun
More information about the Gcc
mailing list