public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/60996] New: Bad code (I.e. needless insns) with option momit-leaf-frame-pointer; side-effect on non-leaf functions
@ 2014-04-29  7:12 meisenmann.lba@fh-salzburg.ac.at
  2021-09-27  1:49 ` [Bug target/60996] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: meisenmann.lba@fh-salzburg.ac.at @ 2014-04-29  7:12 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60996

            Bug ID: 60996
           Summary: Bad code (I.e. needless insns) with option
                    momit-leaf-frame-pointer; side-effect on non-leaf
                    functions
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: meisenmann.lba@fh-salzburg.ac.at

Using the option '-momit-leaf-frame-pointer' (with -fno-omit-frame-pointer) has
a side-effect on non-leaf functions. The code-snippets afterwards (produced
with an i386-elf cross-compiler for an IA32-target) will show the difference:

A) Without the option momit-leaf-frame-pointer:

Example1:
  pushl %ebp
  movl  %esp, %ebp
  pushl %ebx
  subl  $8, %esp
  movl  (%eax), %ebx
  pushl 12(%ebp)
  pushl 8(%ebp)
  pushl %ecx
  pushl %edx
  pushl %eax
  call  *12(%ebx)
  movl  -4(%ebp), %ebx
  leave
  ret

B) Option '-momit-leaf-frame-pointer' used:

Example1:
  pushl %ebp
  movl  %esp, %ebp
  pushl %ebx
  subl  $8, %esp
  movl  (%eax), %ebx
  pushl 12(%ebp)
  pushl 8(%ebp)
  pushl %ecx
  pushl %edx
  pushl %eax
  call  *12(%ebx)
  addl  $24, %esp
  movl  -4(%ebp), %ebx
  leave
  ret

In this case there'a an additional stack-adjustment (addl $24, %esp) before the
"final" stack-leave instruction. Some other examples with less forwarded
call-arguments have shown a few pop-insn instead of an 'add'.
These additional instruction(s) directly before reverting the stack-frame has
no functional effect, but will consume a few CPU-cycles.


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

* [Bug target/60996] Bad code (I.e. needless insns) with option momit-leaf-frame-pointer; side-effect on non-leaf functions
  2014-04-29  7:12 [Bug target/60996] New: Bad code (I.e. needless insns) with option momit-leaf-frame-pointer; side-effect on non-leaf functions meisenmann.lba@fh-salzburg.ac.at
@ 2021-09-27  1:49 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-09-27  1:49 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-09-27
             Status|UNCONFIRMED                 |WAITING

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Can you attach the testcase?

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

end of thread, other threads:[~2021-09-27  1:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-29  7:12 [Bug target/60996] New: Bad code (I.e. needless insns) with option momit-leaf-frame-pointer; side-effect on non-leaf functions meisenmann.lba@fh-salzburg.ac.at
2021-09-27  1:49 ` [Bug target/60996] " pinskia 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).