This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: problem with subregs.
On Thu, 2003-11-27 at 09:57, Tal Agmon wrote:
>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.
Ah, right, so some of my advice was misdirected. Ignore that part.
> 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!
The testcase is "a = &b - &c". If "c" is a local, then because you took
its address it must be on the stack. If "c" is the first (or last?)
local, then its address is the same as one of the virtual registers.
You then subtract them, which forces a conversion to ptrdiff_t. If you
have defined ptrdiff_t to be HImode, then that could be responsible for
the inconvenient RTL you are getting. If so, you might want to consider
changing ptrdiff_t to be SImode instead of HImode. It really isn't very
useful to have a ptrdiff_t that is smaller than the pointer size. That
can cause problems. Likewise for size_t. This implies an ABI change
though, which may cause other problems.
If ptrdiff_t is SImode, then it may be that the store into a is the
problem. If a is a 16-bit int, then that might be forcing the HImode
conversions.
If you can't get this to work, you always have the option of saying that
this operation is not supported for your target. If you are lucky, none
of your users have code that will trigger this problem.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com