public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/49939] New: [avr] Skip 2-word instructions if applicable
@ 2011-08-01 21:00 gjl at gcc dot gnu.org
2011-10-12 10:00 ` [Bug target/49939] " gjl at gcc dot gnu.org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: gjl at gcc dot gnu.org @ 2011-08-01 21:00 UTC (permalink / raw)
To: gcc-bugs
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug target/49939] [avr] Skip 2-word instructions if applicable
2011-08-01 21:00 [Bug target/49939] New: [avr] Skip 2-word instructions if applicable gjl at gcc dot gnu.org
@ 2011-10-12 10:00 ` 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
2 siblings, 0 replies; 4+ messages in thread
From: gjl at gcc dot gnu.org @ 2011-10-12 10:00 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49939
--- Comment #1 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2011-10-12 09:59:34 UTC ---
Author: gjl
Date: Wed Oct 12 09:59:30 2011
New Revision: 179843
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=179843
Log:
PR target/49939
* config/avr/avr.md (*movqi): Rename to movqi_insn.
(*call_insn): Rename to call_insn.
(*call_value_insn): Rename to call_value_insn.
* config/avr/avr.c (avr_2word_insn_p): New static function.
(jump_over_one_insn_p): Use it.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/avr/avr.c
trunk/gcc/config/avr/avr.md
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug target/49939] [avr] Skip 2-word instructions if applicable
2011-08-01 21:00 [Bug target/49939] New: [avr] Skip 2-word instructions if applicable gjl at gcc dot gnu.org
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
2 siblings, 0 replies; 4+ messages in thread
From: gjl at gcc dot gnu.org @ 2011-10-12 10:09 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49939
Georg-Johann Lay <gjl at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.7.0
Known to fail| |4.6.2
--- Comment #2 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2011-10-12 10:09:16 UTC ---
Fixed in 4.7.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug target/49939] [avr] Skip 2-word instructions if applicable
2011-08-01 21:00 [Bug target/49939] New: [avr] Skip 2-word instructions if applicable gjl at gcc dot gnu.org
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
2 siblings, 0 replies; 4+ messages in thread
From: gjl at gcc dot gnu.org @ 2012-02-29 10:02 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49939
--- Comment #3 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2012-02-29 09:50:24 UTC ---
Author: gjl
Date: Wed Feb 29 09:50:19 2012
New Revision: 184656
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=184656
Log:
PR target/49939
* config/avr/avr.h (ASM_SPEC): Add -mno-skip-bug if we know that
the device does not have the skip-bug.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/avr/avr.h
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-02-29 9:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-01 21:00 [Bug target/49939] New: [avr] Skip 2-word instructions if applicable gjl at gcc dot gnu.org
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
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).