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 for sibcalls on i386


On 30-Sep-2002, Andreas Bauer <baueran@in.tum.de> wrote:
> > > +++ pa/pa-linux.h	25 Sep 2002 04:01:52 -0000
> > > @@ -189,3 +185,7 @@ Boston, MA 02111-1307, USA.  */
> > >  /* Linux always uses gas.  */
> > >  #undef TARGET_GAS
> > >  #define TARGET_GAS 1
> > > +
> > > +/* Sibcalls, stubs, and elf sections don't play well.  */
> > > +#undef TARGET_FUNCTION_OK_FOR_SIBCALL
> > > +#define TARGET_FUNCTION_OK_FOR_SIBCALL hook_tree_tree_bool_false
> > [...]
> > > +++ pa/pa.c	25 Sep 2002 04:02:18 -0000
> > > @@ -194,6 +195,9 @@ static size_t n_deferred_plabels = 0;
> > >  #undef TARGET_STRIP_NAME_ENCODING
> > >  #define TARGET_STRIP_NAME_ENCODING pa_strip_name_encoding
> > >  
> > > +#undef TARGET_FUNCTION_OK_FOR_SIBCALL
> > > +#define TARGET_FUNCTION_OK_FOR_SIBCALL pa_function_ok_for_sibcall
> > 
> > The pa-linux definition is no longer in effect.
> 
> What would be the appropriate way to express that it's not ok to do any
> sibcalls when the target is pa-linux?  I'm sure pa.c needs to be changed
> as it now contains the definition for pa_function_ok_for_sibcall, but I'm
> hesitant towards How.
> 
> Something like this, inside pa_function_ok_for_sibcall, would probably
> work:
> 
>    if (TARGET_PA_LINUX)
>       return false;

Well, you could put something like

    #define TARGET_PA_LINUX 1

in config/pa/pa-linux.h, and put

    #ifdef TARGET_PA_LINUX
       return false;
    #endif

in config/pa/pa.c (together with some appropriate comments in both cases).

That would have the desired effect of preserving the current behaviour.
Maybe that is the right thing to do for now.

However, I'm not really satisfied with this as a long term solution,
because testing for TARGET_PA_LINUX seems like the wrong thing to do.
It should instead be testing for some lower-level property.

Perhaps, in view of the comment,

	/* Sibcalls, stubs, and elf sections don't play well.  */

the macro should be named TARGET_HAS_STUBS_AND_ELF_SECTIONS
rather than TARGET_PA_LINUX?

-- 
Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.


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