-ffixed-di vs. strlen
Ian Lance Taylor
ian@wasabisystems.com
Fri Feb 13 20:04:00 GMT 2004
Richard Henderson <rth@redhat.com> writes:
> On Fri, Feb 13, 2004 at 02:40:37PM -0500, Ian Lance Taylor wrote:
> > The problem in this test case is arising with variables which are
> > local to a function but are dedicated to a specific register during
> > that function. I don't think these are tracked anywhere at present.
>
> No they aren't. If this is what the test case does, then I misunderstood
> and I revise my assessment. They don't mean the same thing as variables
> external to the function. They do *not* reserve the register, they merely
> provide access to it. If it gets clobbered, then it gets clobbered.
>
> This feature is only usable in extremely restricted circumstances.
> You really really have to know what you are doing. If it weren't for
> the fact that the feature is essential for implementing system call
> stubs, I might consider deprecating it.
>
> As for generating a sensible "don't do that" error message, I'm not
> really sure how to approach that. Much of the information that you
> might have liked to determine this has been thrown away, afaik.
If we do track local registers, then the i386 backend could choose to
not do string expansions when there di is dedicated to a local
register. This is not perfect, of course, as the variable might not
be live at the time of the string expansion. But then, as you say,
people using this feature need to know what they are doing.
And/or we can generate a better error message by tracking local
registers, and then checking that list in spill_failure(). If there
happens to be a dedicated local register in the class for which a
register could not be found, that suggests the problem. It's not
definitive--there could be a real compiler bug and the local dedicated
register could be a red herring--so the error message would have to
reflect that.
Ian
More information about the Gcc
mailing list