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

Re: Reloading failes


On Mon, 07 Jul 2003 19:18:57 -0700, Jim Wilson <wilson@tuliptree.org> wrote:
andersa@tiscali.no wrote:
(set (reg:SI 2 r3)
(mem/s:SI (plus:SI (mem:SI (plus:SI (reg/f:SI 6 r7)
(const_int -16)))
(const_int 4))))

This looks like a REG_OK_STRICT bug in your port.


Normally, pseudo registers can be treated just like a hard register. However, during reload, any pseudo register remaining will be converted to a stack slot, so they must be treated like a MEM instead of like a REG. This is handled via REG_OK_STRICT. When REG_OK_STRICT is true, we don't accept pseudo registers. When REG_OK_STRICT is false, we do accept pseudo registers.

This is handled for you if you things like GO_IF_LEGITIMATE_ADDRESS are macros in the tm.h file. However, if this calls a function in the target .c file, then you need to manually pass the value of REG_OK_STRICT to the function in the target .c file, and then check the value in that function. There are many ports that do this already. I suggest you look at one of them to see how this is done.

Thank you for your help! As you said, I implemented GO_IF_LEGITIMATE_ADDRESS to only allow index addressing if REG_OK_STRICT wasn't defined. This solved the problem that I was working on at the moment. Now it's back. When compiling gcc.c-torture/compile/920611-2.c with -Os the same is happening; A pseudo register is replaced by a memory reference in reload() in reload1.c. Am I missing something?


(Should I post these kind of messages on gcc or gcc-help?)

Anders


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