public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "gjl at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/49939] New: [avr] Skip 2-word instructions if applicable Date: Mon, 01 Aug 2011 21:00:00 -0000 [thread overview] Message-ID: <bug-49939-4@http.gcc.gnu.org/bugzilla/> (raw) http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49939 Summary: [avr] Skip 2-word instructions if applicable Product: gcc Version: 4.7.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: enhancement Priority: P3 Component: target AssignedTo: unassigned@gcc.gnu.org ReportedBy: gjl@gcc.gnu.org CC: eric.weddington@atmel.com Target: avr Curent avr-gcc from trunk compiles this C code char c; void foo (char a, char b) { if (a) c = b; } with -Os to foo: tst r24 ; 7 *cmpqi/1 [length = 1] breq .L1 ; 8 branch [length = 1] sts c,r22 ; 10 *movqi/3 [length = 2] .L1: ret ; 19 return [length = 1] which could be smarter using a CPSE skip instruction instead like so: foo: cpse r24, __zero_reg__ sts c,r22 .L1: ret At current, avr-gcc just emits skips over 1-word instructions. As of http://gcc.gnu.org/viewcvs?view=revision&revision=177049 avr-gcc now knows if it is also legal to skip 2-word instructions.
next reply other threads:[~2011-08-01 21:00 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-08-01 21:00 gjl at gcc dot gnu.org [this message] 2011-10-12 10:00 ` [Bug target/49939] " gjl at gcc dot gnu.org 2011-10-12 10:09 ` gjl at gcc dot gnu.org 2012-02-29 10:02 ` gjl 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=bug-49939-4@http.gcc.gnu.org/bugzilla/ \ --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).