[Bug target/43095] [avr] GCC produces poor code for 4- and 8-byte values

gjl at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Jul 9 08:28:00 GMT 2011


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.



More information about the Gcc-bugs mailing list