public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug regression/40667]  New: Performance regression: stack frames are generated even with -fomit-frame-pointer
@ 2009-07-07  2:25 mikulas at artax dot karlin dot mff dot cuni dot cz
  2009-07-07  9:07 ` [Bug regression/40667] " rguenth at gcc dot gnu dot org
                   ` (28 more replies)
  0 siblings, 29 replies; 30+ messages in thread
From: mikulas at artax dot karlin dot mff dot cuni dot cz @ 2009-07-07  2:25 UTC (permalink / raw)
  To: gcc-bugs

This is performance regression from 4.3 (which was better).

On i386, when -O2 -fomit-frame-pointer -mpreferred-stack-boundary=2 is used,
and function operates with long long values, stack frame is generated, although
it doesn't have to be.

Example:
int f(long long x);

int g(long long x)
{
        f(x);
        return 0;
}

Generated code:
        .text
        .p2align 4,,15
.globl g
        .type   g, @function
g:
        pushl   %ebp
        movl    %esp, %ebp
        subl    $8, %esp
        movl    8(%ebp), %eax
        movl    12(%ebp), %edx
        movl    %eax, (%esp)
        movl    %edx, 4(%esp)
        call    f
        xorl    %eax, %eax
        leave
        ret
        .size   g, .-g

Gcc 4.3 didn't generate stack frame in this case. On i386, spurious stack frame
is especially bad because there are few registers and one register is lost for
the stack frame. One my program doing heavy 64-bit math shows almost 1% code
size increase because of these unneeded frames.


-- 
           Summary: Performance regression: stack frames are generated even
                    with -fomit-frame-pointer
           Product: gcc
           Version: 4.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: regression
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mikulas at artax dot karlin dot mff dot cuni dot cz
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

end of thread, other threads:[~2010-06-29 21:17 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-07  2:25 [Bug regression/40667] New: Performance regression: stack frames are generated even with -fomit-frame-pointer mikulas at artax dot karlin dot mff dot cuni dot cz
2009-07-07  9:07 ` [Bug regression/40667] " rguenth at gcc dot gnu dot org
2009-07-07 14:41 ` hjl dot tools at gmail dot com
2009-07-07 16:48 ` mikulas at artax dot karlin dot mff dot cuni dot cz
2009-07-09  9:05 ` [Bug rtl-optimization/40667] [4.4/4.5 Regression] " ubizjak at gmail dot com
2009-07-09  9:20 ` ubizjak at gmail dot com
2009-07-09 11:45 ` jakub at gcc dot gnu dot org
2009-07-09 12:05 ` jakub at gcc dot gnu dot org
2009-07-09 12:56 ` jakub at gcc dot gnu dot org
2009-07-09 13:25 ` jakub at gcc dot gnu dot org
2009-07-09 13:58 ` hjl dot tools at gmail dot com
2009-07-09 15:49 ` rguenth at gcc dot gnu dot org
2009-07-09 16:24 ` jakub at gcc dot gnu dot org
2009-07-09 16:35 ` hjl dot tools at gmail dot com
2009-07-11 17:40 ` jakub at gcc dot gnu dot org
2009-07-11 19:06 ` jakub at gcc dot gnu dot org
2009-07-11 19:07 ` jakub at gcc dot gnu dot org
2009-07-23 11:13 ` mikulas at artax dot karlin dot mff dot cuni dot cz
2009-07-23 11:18 ` mikulas at artax dot karlin dot mff dot cuni dot cz
2009-07-23 11:36 ` jakub at gcc dot gnu dot org
2009-07-23 12:17 ` mikulas at artax dot karlin dot mff dot cuni dot cz
2009-07-23 12:34 ` jakub at gcc dot gnu dot org
2009-07-23 13:28 ` mikulas at artax dot karlin dot mff dot cuni dot cz
2009-08-08 10:41 ` mikulas at artax dot karlin dot mff dot cuni dot cz
2009-08-08 11:45 ` hjl dot tools at gmail dot com
2009-08-08 14:15 ` mikulas at artax dot karlin dot mff dot cuni dot cz
2009-08-11 21:01 ` mikulas at artax dot karlin dot mff dot cuni dot cz
2010-02-15  4:23 ` [Bug target/40667] " pinskia at gcc dot gnu dot org
2010-02-15 10:34 ` mikulas at artax dot karlin dot mff dot cuni dot cz
2010-06-29 21:17 ` [Bug target/40667] [4.4/4.5/4.6 " pinskia at gcc dot gnu dot 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).