This is the mail archive of the gcc-patches@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: [Patch, xtensa] Add LOCAL_REGNO to the xtensa backend.


On Tue, Jan 14, 2014 at 7:14 AM, Felix Yang <fei.yang0953@gmail.com> wrote:
> Hi Sterling,
>
>     The xtensa backend uses register windows, and we need to define
> LOCAL_REGNO for it.

Hi Felix,

How does this change the produced code? In particular, please identify
a problem this patch is solving. I know that the documentation for the
macro says to define it if you have register windows, but things
aren't that straightforward.

The original register windowing support in GCC went in to support
Sparc and, iirc, Intel i960. There are subtle differences between the
two ISAs that aren't entirely captured in the GCC infrastructure. Note
that in Sparc the window isn't modified until the save and restore
instructions are executed, whereas in Xtensa, the save and restores
happen combined with call and return.

All of this makes for very subtle data-flow issues around certain
registers--in particular, a8 (which functions as both an argument
register and the frame pointer.) Passing gcc/torture/... isn't enough
to establish that this works. It needs a full set of ABI tests to be
established as correct.

What we have there works perfectly well. Your patch may indeed improve
the generated code, or be more correct, but please identify the
problem you are solving and show how this patch improves things.

Thanks,

Sterling


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