public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/16884] New: [avr-gcc] bug while initialising variables
@ 2004-08-05  1:27 em at la dot mine dot nu
  2004-08-30 19:39 ` [Bug target/16884] " ericw at evcohs dot com
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: em at la dot mine dot nu @ 2004-08-05  1:27 UTC (permalink / raw)
  To: gcc-bugs

int
main( void )
{
  unsigned char   s[8] = { 0x6E, 0x4E, 0xF7, 0x07, 0x41, 0xFA, 0xB9, 0xD4 };
  unsigned char   d[8] = { 0x1B, 0x55, 0x7C, 0xE6, 0x54, 0xAC, 0x54, 0xDB };
  return 0;
}

Compile it with avr-gcc version 3.4.0 and the following flags:
CPFLAGS = -mmcu=atmega16 -g -O3 -funsigned-char -funsigned-bitfields 
-fpack-struct -fshort-enums -Wall -W

The generated code looks like this:

  unsigned char   s[8] = { 0x6E, 0x4E, 0xF7, 0x07, 0x41, 0xFA, 0xB9, 0xD4 };
  96:   88 e0           ldi     r24, 0x08       ; 8
  98:   a0 e6           ldi     r26, 0x60       ; 96
  9a:   b0 e0           ldi     r27, 0x00       ; 0
  9c:   fe 01           movw    r30, r28
  9e:   31 96           adiw    r30, 0x01       ; 1
  a0:   0d 90           ld      r0, X+
  a2:   01 92           st      Z+, r0
  a4:   8a 95           dec     r24
  a6:   e1 f7           brne    .-8             ; 0xa0
  unsigned char   d[8] = { 0x1B, 0x55, 0x7C, 0xE6, 0x54, 0xAC, 0x54, 0xDB };
  a8:   a8 e6           ldi     r26, 0x68       ; 104
  aa:   b0 e0           ldi     r27, 0x00       ; 0
  ac:   fe 01           movw    r30, r28
  ae:   39 96           adiw    r30, 0x09       ; 9
  b0:   0d 90           ld      r0, X+
  b2:   01 92           st      Z+, r0
  b4:   8a 95           dec     r24
  b6:   e1 f7           brne    .-8             ; 0xb0

For the second initialisation there is a "ldi r24, 0x08" instruction
missing from the code.

-- 
           Summary: [avr-gcc] bug while initialising variables
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: em at la dot mine dot nu
                CC: gcc-bugs at gcc dot gnu dot org


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


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

end of thread, other threads:[~2004-10-17 20:07 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-05  1:27 [Bug target/16884] New: [avr-gcc] bug while initialising variables em at la dot mine dot nu
2004-08-30 19:39 ` [Bug target/16884] " ericw at evcohs dot com
2004-08-30 19:45 ` [Bug target/16884] [3.4/3.5? Regression] " pinskia at gcc dot gnu dot org
2004-08-31  5:22 ` pinskia at gcc dot gnu dot org
2004-09-02 17:20 ` cvs-commit at gcc dot gnu dot org
2004-09-03  1:19 ` [Bug target/16884] [3.4 Regression] [avr-gcc] [fweb related] " pinskia at gcc dot gnu dot org
2004-09-22 13:35 ` [Bug target/16884] [3.4 Regression] " pinskia at gcc dot gnu dot org
2004-09-23  0:28 ` giovannibajo at libero dot it
2004-09-24 15:21 ` cvs-commit at gcc dot gnu dot org
2004-09-24 15:51 ` pinskia at gcc dot gnu dot org
2004-10-17 16:24 ` pinskia at gcc dot gnu dot org
2004-10-17 20:07 ` ralf_corsepius at rtems dot 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).