This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/43095] [avr] GCC produces poor code for 4- and 8-byte values
- From: "gjl at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 9 Jul 2011 08:28:01 +0000
- Subject: [Bug target/43095] [avr] GCC produces poor code for 4- and 8-byte values
- Auto-submitted: auto-generated
- References: <bug-43095-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43095
Georg-Johann Lay <gjl at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |missed-optimization
Status|UNCONFIRMED |RESOLVED
CC| |gjl at gcc dot gnu.org
Known to work| |4.6.1
Resolution| |WORKSFORME
--- Comment #1 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2011-07-09 08:26:26 UTC ---
Closed as WORKS FOR ME
I compiled that with
$ avr-gcc-4.6.1 -dp -Os -S -mmcu=atmega88
and the result is:
greater_than_32:
ldi r30,lo8(1) ; 7 *movqi/2 [length = 1]
cp r18,r22 ; 8 *cmpsi/2 [length = 4]
cpc r19,r23
cpc r20,r24
cpc r21,r25
brlt .L2 ; 9 branch [length = 1]
ldi r30,lo8(0) ; 10 *movqi/1 [length = 1]
.L2:
mov r24,r30 ; 16 *movqi/1 [length = 1]
ret ; 28 return [length = 1]
For the 64-bit case, user must be aware that avr-gcc will produce bulky code.
Because of shortness of contributors to avr-gcc, the avr port maintainers
regard missed 64-bit optimizations as WON'T FIX.