This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/82935] Unnecessary "sub rsp, 8", "call" and "add rsp, 8" instructions
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 10 Nov 2017 10:56:45 +0000
- Subject: [Bug target/82935] Unnecessary "sub rsp, 8", "call" and "add rsp, 8" instructions
- Auto-submitted: auto-generated
- References: <bug-82935-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82935
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Well, clang uses a tail call, and we don't. And the reason why we don't is
that the call is introduced only during expansion and doesn't therefore have
the
GF_CALL_TAILCALL flag set (CALL_EXPR_TAILCALL on the CALL_EXPR).
The options I see (Richard, any preferences?):
1) turn aggregate assignments during the tailcall pass if at tailcall positions
into calls and set the flag
2) introduce a flag like GF_CALL_TAILCALL on structure assignment statements or
aggregate clearing, compute it during tailcall pass and check that flag during
aggregate copy/clear expansion
3) perform the analysis the tailcall pass does during expansion of aggregate
assignment or aggregate clearing