ian@sibyl.eleceng.ua.OZ (Ian Dall) (08/25/89)
I have just been porting gcc-1.35 to my NS icm3216 and I have a question about what FIX_FRAME_POINTER_ADDRESS is supposed to do. When I use the FIX_FRAME_POINTER_ADDRESS in tm-ns32k.h the compiler aborts when trying to compile insn-extract.c. The problem seems to be that FIX_FRAME_POINTER_ADDRESS only is designed to cope with a subclass of possible addresses describable by rtl trees. The FIX_FRAME_POINTER_ADDRESS macros for other machines also seem to be limited to a subclass of possible addresses. The relevant comment in the tm-* files is /* If the memory address ADDR is relative to the frame pointer, correct it to be relative to the stack pointer instead. This is for when we don't use a frame pointer. ADDR should be a variable name. */ I used gdb to print the rtl which FIX_FRAME_POINTER_ADDRESS is trying to operate on (in reload1) and it is not a structure which can be represented by a NS32k addressing mode so I assume that at this point the rtl has still not been transformed into a machine representable form. As far as I can see, the address at this point could be an arbitrarilly complex rtl tree and no simple inline code would do. I tried making FIX_FRAME_POINTER_ADDRESS call alter_frame_pointer_addresses to alter the sub expressions whenever a (MEM sub-expression) is encountered. Since alter_frame_pointer_addresses invokes FIX_FRAME_POINTER_ADDRESS this is potentially recursive and hence able to handle rtl trees of arbitrary depth. This seemed to be an improvement but I still can't recompile gcc with -fomit-frame-pointer successfully. What I would like to know is whether the rtl tree passed to FIX_FRAME_POINTER_ADDRESS is limited in complexity in some way (number of registers, number of memory references, depth etc) and if so what parameters in the machine definition effect it. Also, why does FIX_FRAME_POINTER_ADDRESS need to be machine dependent? It seems to me that it should be possible make use of the stack direction, and register size to write a recursive function to fix pretty much any machines frame pointer address. Any pointers would be much appreciated. There seem to be a number of errors in the generic tm-ns32k.h and a fewer number in ns32k.md. I have bugfixes as well as enhancements and I will send them in when I have finalised them. I can currently pass the stage2 recompilation test as well as build GNU emacs successfully. I would like that -fomit-frame-pointer option to work though! -- Ian Dall life (n). A sexually transmitted disease which afflicts some people more severely than others.