public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "rask at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/11180] [avr-gcc] Optimization decrease performance of struct assignment. Date: Sun, 16 Sep 2007 13:38:00 -0000 [thread overview] Message-ID: <20070916133848.23219.qmail@sourceware.org> (raw) In-Reply-To: <bug-11180-6291@http.gcc.gnu.org/bugzilla/> ------- Comment #16 from rask at gcc dot gnu dot org 2007-09-16 13:38 ------- Created an attachment (id=14211) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14211&action=view) quick and dirty patch to reduce code size A fundamental problem with the AVR back end is that it sabotages the RTL optimizer's attempts to optimize away redundant move insns. With this patch, I get better code (-O2): foo: push r29 ; 73 *pushhi/1 [length = 2] push r28 rcall . ; 79 *addhi3_sp_R_pc2 [length = 3] rcall . rcall . in r28,__SP_L__ ; 90 *movqi/6 [length = 1] in r29,__SP_H__ ; 91 *movqi/6 [length = 1] /* prologue: function */ /* frame size = 6 */ ldi r24,lo8(2) ; 68 *movqi/2 [length = 1] std Y+5,r24 ; 70 *movqi/3 [length = 1] std Y+6,__zero_reg__ ; 71 *movqi/3 [length = 1] ldi r22,lo8(2) ; 21 *movqi/2 [length = 1] ldi r23,lo8(0) ; 23 *movqi/2 [length = 1] ldi r18,lo8(1) ; 42 *movqi/2 [length = 1] ldi r19,lo8(0) ; 43 *movqi/2 [length = 1] ldi r20,lo8(0) ; 44 *movqi/2 [length = 1] ldi r21,lo8(0) ; 45 *movqi/2 [length = 1] ldi r24,lo8(0) ; 48 *movqi/2 [length = 1] ldi r25,lo8(0) ; 49 *movqi/2 [length = 1] /* epilogue start */ adiw r28,6 ; 85 *addhi3/2 [length = 1] out __SP_L__,r28 ; 92 *movqi/5 [length = 1] out __SP_H__,r29 ; 93 *movqi/5 [length = 1] pop r28 ; 87 pophi [length = 2] pop r29 ret ; 88 return_from_epilogue [length = 1] .size foo, .-foo /* File "/home/rask/pr11180.c": code 0 = 0x0000 ( 0), prologues 0, epilogues 0 */ Perhaps a peephole optimization could replace insns 48 and 49 with "movw r25:r24, r21:r20". The only big further improvement I see would be to get rid of the stack var. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11180
next prev parent reply other threads:[~2007-09-16 13:38 UTC|newest] Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <bug-11180-6291@http.gcc.gnu.org/bugzilla/> 2007-07-24 23:50 ` eweddington at cso dot atmel dot com 2007-07-27 1:24 ` dmixm at marine dot febras dot ru 2007-07-27 14:23 ` eweddington at cso dot atmel dot com 2007-09-09 21:59 ` dmixm at marine dot febras dot ru 2007-09-11 16:11 ` eweddington at cso dot atmel dot com 2007-09-16 3:22 ` dmixm at marine dot febras dot ru 2007-09-16 12:57 ` rask at gcc dot gnu dot org 2007-09-16 13:38 ` rask at gcc dot gnu dot org [this message] 2007-09-16 13:54 ` rask at gcc dot gnu dot org 2007-09-16 15:44 ` eweddington at cso dot atmel dot com 2007-09-16 17:30 ` rask at gcc dot gnu dot org 2007-09-17 2:32 ` eweddington at cso dot atmel dot com 2007-09-17 11:13 ` rask at gcc dot gnu dot org 2007-09-17 22:53 ` eweddington at cso dot atmel dot com 2007-09-18 7:14 ` rask at gcc dot gnu dot org 2007-09-18 19:06 ` eweddington at cso dot atmel dot com 2007-09-18 19:49 ` rask at gcc dot gnu dot org 2007-09-19 5:28 ` eweddington at cso dot atmel dot com 2007-09-19 17:58 ` eweddington at cso dot atmel dot com 2008-02-02 15:45 ` hutchinsonandy at aim dot com 2008-02-19 2:47 ` eric dot weddington at atmel dot com [not found] <bug-11180-4@http.gcc.gnu.org/bugzilla/> 2013-02-22 18:43 ` gjl at gcc dot gnu.org 2023-06-21 3:54 ` pinskia at gcc dot gnu.org 2003-07-06 1:24 [Bug optimization/11180] New: " pinskia at physics dot uc dot edu 2004-01-03 19:00 ` [Bug target/11180] " pinskia at gcc dot gnu dot org 2005-01-09 1:30 ` pinskia at gcc dot gnu dot org 2005-03-27 14:33 ` andrewhutchinson at cox dot net 2005-06-26 2:26 ` pinskia at gcc dot gnu dot org 2005-06-26 15:06 ` schlie at comcast dot net
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=20070916133848.23219.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: linkBe 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).