public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/98289] New: [x86] Suboptimal optimization of stack usage when function call to cold function is not needed
@ 2020-12-15 14:46 gabravier at gmail dot com
  2020-12-15 17:24 ` [Bug target/98289] [8/9/10/11 Regression] [x86] Suboptimal optimization of stack usage when function call does not occur jakub at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: gabravier at gmail dot com @ 2020-12-15 14:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98289

            Bug ID: 98289
           Summary: [x86] Suboptimal optimization of stack usage when
                    function call to cold function is not needed
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gabravier at gmail dot com
  Target Milestone: ---

void f(bool cond)
{
    if (cond)
        __builtin_abort();
}

On x86 with current trunk and -O3, this results in :

f(bool):
  sub rsp, 8
  test dil, dil
  jne .L3
  add rsp, 8
  ret
f(bool) [clone .cold]:
.L3:
  call abort

This seems like a regression over GCC 7.5, which outputs :

f(bool):
  test dil, dil
  jne .L7
  rep ret
.L7:
  sub rsp, 8
  call abort

Along with LLVM, which has similar output. Only emitting the code to begin the
call upon being asked to do seems quicker in the case where the call doesn't
occur.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-12-29 13:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-15 14:46 [Bug target/98289] New: [x86] Suboptimal optimization of stack usage when function call to cold function is not needed gabravier at gmail dot com
2020-12-15 17:24 ` [Bug target/98289] [8/9/10/11 Regression] [x86] Suboptimal optimization of stack usage when function call does not occur jakub at gcc dot gnu.org
2020-12-15 18:03 ` jakub at gcc dot gnu.org
2020-12-15 18:23 ` jakub at gcc dot gnu.org
2020-12-17 12:30 ` [Bug rtl-optimization/98289] " cvs-commit at gcc dot gnu.org
2020-12-29 13:35 ` [Bug rtl-optimization/98289] [8/9/10 " jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).