public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "andrewhutchinson at cox dot net" <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, 27 Mar 2005 14:33:00 -0000 [thread overview] Message-ID: <20050327143311.5548.qmail@sourceware.org> (raw) In-Reply-To: <20030613023559.11180.dmixm@marine.febras.ru> ------- Additional Comments From andrewhutchinson at cox dot net 2005-03-27 14:33 ------- The problem here is that gcc is using a DImode register to handle 6 byte (int+long) structure. Why I have no idea! Since the target has no insn for DI move, gcc turns this into individual QImode byte moves (subregs all over the place!). The 'stacked' 6 byte structure is 'popped' into DI register (6 bytes ). Two other byte registers are explicitely cleared (making our 8 byte DI register) What then follows is a large amount of shuffling. i.e. Moving from intermediate virtual DI register (8 bytes) into correct place for a 6 byte return. Which seems to surpass the abilities of the register allocator (DI and return registers overlap). Smaller structures (<=4 bytes) are optimally handled. Larger structure >8 are also much better since they are returned in memory. So in summary, it would appear that the root cause is allocation of a DI mode register for structures >4 and <=8 bytes. A secondary factor is the use of QImode moves (when SI,HImode are available and more efficient) The problem can be partially alleviated by defining DImode moves (that a hell of a change though). Poor code still remains - for example clearing unused padding bytes and extra register usage. PS -fpack-struct does not change this bug. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11180
next prev parent reply other threads:[~2005-03-27 14:33 UTC|newest] Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top 2003-07-06 1:24 [Bug optimization/11180] New: " pinskia at physics dot uc dot edu 2003-07-06 1:59 ` [Bug optimization/11180] " pinskia at physics dot uc dot edu 2003-07-10 13:38 ` steven at gcc dot gnu dot org 2003-07-10 21:03 ` 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 [this message] 2005-06-26 2:26 ` pinskia at gcc dot gnu dot org 2005-06-26 15:06 ` schlie at comcast dot net [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 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
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=20050327143311.5548.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).