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: Potential fix for PR24374


That's also bad.  There is no reason to modify generic code,
targets have already a hook to disable tail call optimization.
Look at ix86_function_ok_for_sibcall.
I tried that first. I couldn't figure out how to get
MAIN_NAME_P to correctly identity main from the argument
to that function. If you could tell me how to do that,
I'll happily change it. But it seems less invasive to
me to have the conditionally compiled code like it is
in calls.c than to have to change (if more than one
target finds it needs this set) many different target
hook functions.

Also, only -m32 compiled code adjusts stack in main, so please
don't impose that limitation on x86_64 code.
This doesn't control adjusting the stack, it only controls
sibling call optimization for main. The only "penalty" you
will pay is if you have code like:

int main1(void) {}

int main(void) { return main1();}

That you will get an actual call to main1. And *only* in
the case of main. Thats a pretty miniscule "limitation"
on x86_64 code.

Kean


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