public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "steven at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/40657] allocate local variables with fewer instructions
Date: Mon, 06 Jul 2009 10:43:00 -0000	[thread overview]
Message-ID: <20090706104305.26924.qmail@sourceware.org> (raw)
In-Reply-To: <bug-40657-17659@http.gcc.gnu.org/bugzilla/>



------- Comment #4 from steven at gcc dot gnu dot org  2009-07-06 10:43 -------
Ah, heh, so you're saying that pushing/popping registers you don't have to save
may be a size optimization? That's an interesting idea.

But how to do this in GCC...  The "push {lr}" is never even in the RTL.  Output
with same options + "-dAP":

foo:
        push    {lr}
        @ basic block 2
@(insn/f 20 2 21 t.c:3 (set (reg/f:SI 13 sp)
@        (plus:SI (reg/f:SI 13 sp)
@            (const_int -12 [0xfffffffffffffff4]))) 5 {*thumb1_addsi3} (nil))
@ 0x0000
        sub     sp, sp, #12     @ 20    *thumb1_addsi3/7        [length = 2]
@(insn 6 21 7 t.c:5 (set (reg:SI 0 r0)
@        (plus:SI (reg/f:SI 13 sp)
@            (const_int 4 [0x4]))) 5 {*thumb1_addsi3} (expr_list:REG_EQUAL
(plus:SI (reg/f:SI 13 sp)
@            (const_int 4 [0x4]))
@        (nil)))
@ 0x0002
        add     r0, sp, #4      @ 6     *thumb1_addsi3/6        [length = 2]
@(call_insn 7 6 13 t.c:5 (parallel [
@            (call (mem:SI (symbol_ref:SI ("bar") [flags 0x41] <function_decl
0x2000000000545200 bar>) [0 S4 A32])
@                (const_int 0 [0x0]))
@            (use (const_int 0 [0x0]))
@            (clobber (reg:SI 14 lr))
@        ]) 253 {*call_insn} (expr_list:REG_DEAD (reg:SI 0 r0)
@        (nil))
@    (expr_list:REG_DEP_TRUE (use (reg:SI 0 r0))
@        (nil)))
@ 0x0004
        bl      bar     @ 7     *call_insn      [length = 4]
@(insn 13 7 22 t.c:7 (set (reg/i:SI 0 r0)
@        (mem/c/i:SI (plus:SI (reg/f:SI 13 sp)
@                (const_int 4 [0x4])) [2 x+0 S4 A32])) 167 {*thumb1_movsi_insn}
(nil))
@ 0x0008
        ldr     r0, [sp, #4]    @ 13    *thumb1_movsi_insn/7    [length = 2]
@(insn 23 22 16 t.c:7 (set (reg/f:SI 13 sp)
@        (plus:SI (reg/f:SI 13 sp)
@            (const_int 12 [0xc]))) 5 {*thumb1_addsi3} (nil))
@ 0x000a
        add     sp, sp, #12     @ 23    *thumb1_addsi3/7        [length = 2]
@(insn 24 16 25 t.c:7 (unspec:SI [
@            (reg/f:SI 13 sp)
@        ] 6) 339 {prologue_use} (nil))
@ 0x000c
        @ sp needed for prologue        @ 24    prologue_use    [length = 0]
@(jump_insn 25 24 26 t.c:7 (unspec_volatile [
@            (return)
@        ] 1) 321 {*epilogue_insns} (nil))
@ 0x000c
        pop     {pc}


-- 


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


  parent reply	other threads:[~2009-07-06 10:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-06  8:16 [Bug target/40657] New: " carrot at google dot com
2009-07-06  8:16 ` [Bug target/40657] " carrot at google dot com
2009-07-06  9:14 ` steven at gcc dot gnu dot org
2009-07-06  9:55 ` ramana at gcc dot gnu dot org
2009-07-06 10:43 ` steven at gcc dot gnu dot org [this message]
2009-07-07  6:45 ` carrot at google dot com
2009-07-13 14:23 ` rearnsha at arm dot com
2009-12-22 22:53 ` ramana at gcc dot gnu dot org
2010-03-31 21:42 ` bernds at codesourcery dot com
2010-04-27  9:34 ` bernds at gcc dot gnu dot org
2010-04-27  9:36 ` bernds at gcc dot gnu dot org
2010-07-02 17:41 ` carrot at google dot com
2010-07-09  9:03 ` bernds at gcc dot gnu dot org
     [not found] <bug-40657-4@http.gcc.gnu.org/bugzilla/>
2012-06-20 18:24 ` aldot at gcc dot gnu.org
2012-06-20 18:31 ` bernds at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090706104305.26924.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).