public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/57931] New: There are superfluous movw instructions in when using GCC-AVR (WinAVR) asm code.
@ 2013-07-18 23:40 NickParker at Eaton dot com
  2013-09-09 16:58 ` [Bug target/57931] There are superfluous movw instructions in generated ASM code with GCC-AVR (WinAVR) gjl at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: NickParker at Eaton dot com @ 2013-07-18 23:40 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57931

            Bug ID: 57931
           Summary: There are superfluous movw instructions in when using
                    GCC-AVR (WinAVR) asm code.
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: NickParker at Eaton dot com

Created attachment 30526
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30526&action=edit
C code and a listing

There are superfluous movw instructions in when using GCC-AVR (WinAVR) asm
code.

Might as well make some tighter code here!


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug target/57931] There are superfluous movw instructions in generated ASM code with GCC-AVR (WinAVR)
  2013-07-18 23:40 [Bug c/57931] New: There are superfluous movw instructions in when using GCC-AVR (WinAVR) asm code NickParker at Eaton dot com
@ 2013-09-09 16:58 ` gjl at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: gjl at gcc dot gnu.org @ 2013-09-09 16:58 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57931

Georg-Johann Lay <gjl at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization
             Target|                            |avr
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |gjl at gcc dot gnu.org
         Resolution|---                         |WORKSFORME
              Build|avr                         |

--- Comment #1 from Georg-Johann Lay <gjl at gcc dot gnu.org> ---
Newest "WinAVR" is avr-gcc 4.3.3 and thus is pretty much outdated.

I cannot confirm this with 4.8 where the generated code (after adding #include
<stdint> to the source) reads:

$ avr-gcc foo.c -mmcu=attiny85 -Os -std=gnu99 -S

median:
/* prologue: function */
/* frame size = 0 */
/* stack size = 0 */
.L__stack_usage = 0
    cp r24,r22
    cpc r25,r23
    brge .L2
    cp r24,r20
    cpc r25,r21
    brge .L3
    movw r24,r22
    rjmp .L10
.L2:
    cp r22,r20
    cpc r23,r21
    brge .L7
.L10:
    cp r20,r24
    cpc r21,r25
    brge .L3
    movw r24,r20
    ret
.L7:
    movw r24,r22
.L3:
    ret


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-09-09 16:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-18 23:40 [Bug c/57931] New: There are superfluous movw instructions in when using GCC-AVR (WinAVR) asm code NickParker at Eaton dot com
2013-09-09 16:58 ` [Bug target/57931] There are superfluous movw instructions in generated ASM code with GCC-AVR (WinAVR) 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).