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]

Re: Patch to improve x86 prologue (Version 2)


> I'm trying to think of a reason one might want to know
> current_function_only_uses_leaf_regs && !current_function_is_leaf.

I'm thinking more of the situation where current_function_is_leaf
is used in determining the INITIAL_ELIMINATION_OFFSET (such as
in the suggested i386.c change) and where
!current_function_only_uses_leaf_regs possibly due to inline
assembly code.

> I'd had it in my head to set current_function_is_leaf before
> reload as you do in your patch, and then after reload do
> 
> #ifdef LEAF_REGISTERS
>   if (current_function_is_leaf && ! only_leaf_regs_used ())
>     current_function_is_leaf = 0;
> #endif

Changing current_function_is_leaf after reload and prior to outputting
the prologue (assuming that it's not generated in rtl) will cause
problems since now the initial offset used by reload doesn't agree with
the inital offset setup by the prologue.  This is of course assuming a
port that has leaf registers, uses current_function_is_leaf in
determining the initial offsets, and doesn't output the prologue as
rtl.  Currently there is no such port. :-)

-- John
-------------------------------------------------------------------------
|   Feith Systems  |   Voice: 1-215-646-8000  |  Email: john@feith.com  |
|    John Wehle    |     Fax: 1-215-540-5495  |                         |
-------------------------------------------------------------------------



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