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: problem with subregs.


Jim Wilson wrote:
>Sorry.  I forgot about the virtual reg instantiation problems.  There
>are ways to work around this.

>See for instance the thumb (arm) port.  The THUMB_REG_MODE_OK_FOR_BASE_P
>macro does not allow virtual registers, and it does not allow SP/FP/AP
>in any sub-word mode.  Also, there are predicates that contain the same
>test, namely thumb_base_register_rtx_p, and thumb_legitimate_address_p.
>You will need to do something similar for your port, though the details
>may vary.

Forgive me to bring it up again, but I still have problems in this area and
there is one thing that I don't understand:

The macro REG_MODE_OK_FOR_BASE_P checks register and the mode of the memory
reference - which is the memory the address with the base register is
pointing
to. So thumb doesn't allow base registers that POINT to sub-word and not,
like in my case, registers that are in subregs of sub-word.

I remind you that I didn't talk about addresses but about a simple sub
insn:

Tal Agmon wrote:
>>contains the line a = &b - &c;    (a is int) and the compiler issued the
error:

The variable c is the low part of virtual-stack-vars. Not some
variable that virtual-stack-vars is pointing to. This is a rare case!

>>internal compiler error: in ?, at gcc-3.3.2\gcc\function.c:3776
>>The insn that cause this is:

>>(insn 350 1020 351 61 007A63F0 (set (reg:HI 79)
>>        (minus:HI (subreg:HI (reg/v/f:SI 24) 0)
>>            (subreg:HI (reg/f:SI 17 virtual-stack-vars) 0))) -1 (nil)
>>    (nil))

Am I missing something here?

Thanks you,

Tal.





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