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
* [Bug target/16884] [avr-gcc] bug while initialising variables 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 ` 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 ` (9 subsequent siblings) 10 siblings, 0 replies; 12+ messages in thread From: ericw at evcohs dot com @ 2004-08-30 19:39 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From ericw at evcohs dot com 2004-08-30 19:39 ------- avr-gcc 3.3.2, same flags, seems to work: ------------------------ 4:bug16884.c **** unsigned char s[8] = { 0x6E, 0x4E, 0xF7, 0x07, 0x41, 0xFA, 0xB9, 0xD4 }; 69 .LM2: 70 .LBB2: 71 0008 28E0 ldi r18,lo8(8) 72 000a DE01 movw r26,r28 73 000c 1196 adiw r26,1 74 000e E0E0 ldi r30,lo8(.LC0) 75 0010 F0E0 ldi r31,hi8(.LC0) 76 0012 0190 ld __tmp_reg__,Z+ 77 0014 0D92 st X+,__tmp_reg__ 78 0016 2A95 dec r18 79 0018 E1F7 brne .-8 5:bug16884.c **** unsigned char d[8] = { 0x1B, 0x55, 0x7C, 0xE6, 0x54, 0xAC, 0x54, 0xDB }; 81 .LM3: 82 001a 28E0 ldi r18,lo8(8) 83 001c DE01 movw r26,r28 84 001e 1996 adiw r26,9 85 0020 E0E0 ldi r30,lo8(.LC1) 86 0022 F0E0 ldi r31,hi8(.LC1) 87 0024 0190 ld __tmp_reg__,Z+ 88 0026 0D92 st X+,__tmp_reg__ 89 0028 2A95 dec r18 90 002a E1F7 brne .-8 6:bug16884.c **** return 0; ------------------------ Bug confirmed with avr-gcc 3.4.1, same flags: ------------------------ 4:bug16884.c **** unsigned char s[8] = { 0x6E, 0x4E, 0xF7, 0x07, 0x41, 0xFA, 0xB9, 0xD4 }; 69 .LM2: 70 0008 88E0 ldi r24,lo8(8) 71 000a A0E0 ldi r26,lo8(.LC0) 72 000c B0E0 ldi r27,hi8(.LC0) 73 000e FE01 movw r30,r28 74 0010 3196 adiw r30,1 75 0012 0D90 ld __tmp_reg__,X+ 76 0014 0192 st Z+,__tmp_reg__ 77 0016 8A95 dec r24 78 0018 E1F7 brne .-8 5:bug16884.c **** unsigned char d[8] = { 0x1B, 0x55, 0x7C, 0xE6, 0x54, 0xAC, 0x54, 0xDB }; 80 .LM3: 81 001a A0E0 ldi r26,lo8(.LC1) 82 001c B0E0 ldi r27,hi8(.LC1) 83 001e FE01 movw r30,r28 84 0020 3996 adiw r30,9 85 0022 0D90 ld __tmp_reg__,X+ 86 0024 0192 st Z+,__tmp_reg__ 87 0026 8A95 dec r24 88 0028 E1F7 brne .-8 ------------------------ There is no LDI instruction after the d[8] declaration that loads the register with the value that gets decremented with the following DEC instruction. I would suggest marking this bug as NEW. Also, please mark "Known to work" field with 3.3.2, and mark "Known to fail" field with 3.4.0, 3.4.1. Thanks Eric Weddington WinAVR Admin -- What |Removed |Added ---------------------------------------------------------------------------- CC| |ericw at evcohs dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16884 ^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug target/16884] [3.4/3.5? Regression] [avr-gcc] bug while initialising variables 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 ` pinskia at gcc dot gnu dot org 2004-08-31 5:22 ` pinskia at gcc dot gnu dot org ` (8 subsequent siblings) 10 siblings, 0 replies; 12+ messages in thread From: pinskia at gcc dot gnu dot org @ 2004-08-30 19:45 UTC (permalink / raw) To: gcc-bugs -- What |Removed |Added ---------------------------------------------------------------------------- Keywords| |wrong-code Known to fail| |3.4.0 Known to work| |3.3.2 Summary|[avr-gcc] bug while |[3.4/3.5? Regression] [avr- |initialising variables |gcc] bug while initialising | |variables Target Milestone|--- |3.4.2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16884 ^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug target/16884] [3.4/3.5? Regression] [avr-gcc] bug while initialising variables 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 ` (7 subsequent siblings) 10 siblings, 0 replies; 12+ messages in thread From: pinskia at gcc dot gnu dot org @ 2004-08-31 5:22 UTC (permalink / raw) To: gcc-bugs -- What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|3.4.2 |3.4.3 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16884 ^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug target/16884] [3.4/3.5? Regression] [avr-gcc] bug while initialising variables 2004-08-05 1:27 [Bug target/16884] New: [avr-gcc] bug while initialising variables em at la dot mine dot nu ` (2 preceding siblings ...) 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 ` (6 subsequent siblings) 10 siblings, 0 replies; 12+ messages in thread From: cvs-commit at gcc dot gnu dot org @ 2004-09-02 17:20 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-09-02 17:20 ------- Subject: Bug 16884 CVSROOT: /cvs/gcc Module name: gcc Changes by: denisc@gcc.gnu.org 2004-09-02 17:20:05 Modified files: gcc : ChangeLog gcc/config/avr : avr.md Log message: PR target/16884 * config/avr/avr.md ("movmemhi"): Substitute match_dup to match_scratch. (*movmemqi_insn): Likewise. (*movmemhi): Likewise. (clrmemhi): Likewise. (*clrmemqi): Likewise. (*clrmemhi): Likewise. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.5209&r2=2.5210 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/avr/avr.md.diff?cvsroot=gcc&r1=1.46&r2=1.47 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16884 ^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug target/16884] [3.4 Regression] [avr-gcc] [fweb related] bug while initialising variables 2004-08-05 1:27 [Bug target/16884] New: [avr-gcc] bug while initialising variables em at la dot mine dot nu ` (3 preceding siblings ...) 2004-09-02 17:20 ` cvs-commit at gcc dot gnu dot org @ 2004-09-03 1:19 ` 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 ` (5 subsequent siblings) 10 siblings, 0 replies; 12+ messages in thread From: pinskia at gcc dot gnu dot org @ 2004-09-03 1:19 UTC (permalink / raw) To: gcc-bugs -- What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed| |1 Last reconfirmed|0000-00-00 00:00:00 |2004-09-03 01:19:27 date| | Summary|[3.4/3.5? Regression] [avr- |[3.4 Regression] [avr-gcc] |gcc] bug while initialising |[fweb related] bug while |variables |initialising variables http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16884 ^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug target/16884] [3.4 Regression] [fweb related] bug while initialising variables 2004-08-05 1:27 [Bug target/16884] New: [avr-gcc] bug while initialising variables em at la dot mine dot nu ` (4 preceding siblings ...) 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 ` pinskia at gcc dot gnu dot org 2004-09-23 0:28 ` giovannibajo at libero dot it ` (4 subsequent siblings) 10 siblings, 0 replies; 12+ messages in thread From: pinskia at gcc dot gnu dot org @ 2004-09-22 13:35 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From pinskia at gcc dot gnu dot org 2004-09-22 13:35 ------- *** Bug 17602 has been marked as a duplicate of this bug. *** -- What |Removed |Added ---------------------------------------------------------------------------- CC| |jurij dot kotar at gmail dot | |com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16884 ^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug target/16884] [3.4 Regression] [fweb related] bug while initialising variables 2004-08-05 1:27 [Bug target/16884] New: [avr-gcc] bug while initialising variables em at la dot mine dot nu ` (5 preceding siblings ...) 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 ` (3 subsequent siblings) 10 siblings, 0 replies; 12+ messages in thread From: giovannibajo at libero dot it @ 2004-09-23 0:28 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From giovannibajo at libero dot it 2004-09-23 00:28 ------- Denis, would you please backport the patch to the 3.4 branch so that we can close this PR? Thanks. -- What |Removed |Added ---------------------------------------------------------------------------- CC| |denisc at overta dot ru AssignedTo|unassigned at gcc dot gnu |denisc at overta dot ru |dot org | Status|NEW |ASSIGNED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16884 ^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug target/16884] [3.4 Regression] [fweb related] bug while initialising variables 2004-08-05 1:27 [Bug target/16884] New: [avr-gcc] bug while initialising variables em at la dot mine dot nu ` (6 preceding siblings ...) 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 ` (2 subsequent siblings) 10 siblings, 0 replies; 12+ messages in thread From: cvs-commit at gcc dot gnu dot org @ 2004-09-24 15:21 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-09-24 15:21 ------- Subject: Bug 16884 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-branch Changes by: denisc@gcc.gnu.org 2004-09-24 15:20:58 Modified files: gcc : ChangeLog gcc/config/avr : avr.md Log message: PR target/16884 * config/avr/avr.md ("movmemhi"): Substitute match_dup to match_scratch. (*movmemqi_insn): Likewise. (*movmemhi): Likewise. (clrmemhi): Likewise. (*clrmemqi): Likewise. (*clrmemhi): Likewise. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.633&r2=2.2326.2.634 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/avr/avr.md.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.42&r2=1.42.4.1 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16884 ^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug target/16884] [3.4 Regression] [fweb related] bug while initialising variables 2004-08-05 1:27 [Bug target/16884] New: [avr-gcc] bug while initialising variables em at la dot mine dot nu ` (7 preceding siblings ...) 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 10 siblings, 0 replies; 12+ messages in thread From: pinskia at gcc dot gnu dot org @ 2004-09-24 15:51 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From pinskia at gcc dot gnu dot org 2004-09-24 15:50 ------- Fixed. -- What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16884 ^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug target/16884] [3.4 Regression] [fweb related] bug while initialising variables 2004-08-05 1:27 [Bug target/16884] New: [avr-gcc] bug while initialising variables em at la dot mine dot nu ` (8 preceding siblings ...) 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 10 siblings, 0 replies; 12+ messages in thread From: pinskia at gcc dot gnu dot org @ 2004-10-17 16:24 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-17 16:24 ------- *** Bug 18039 has been marked as a duplicate of this bug. *** -- What |Removed |Added ---------------------------------------------------------------------------- CC| |ralf_corsepius at rtems dot | |org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16884 ^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug target/16884] [3.4 Regression] [fweb related] bug while initialising variables 2004-08-05 1:27 [Bug target/16884] New: [avr-gcc] bug while initialising variables em at la dot mine dot nu ` (9 preceding siblings ...) 2004-10-17 16:24 ` pinskia at gcc dot gnu dot org @ 2004-10-17 20:07 ` ralf_corsepius at rtems dot org 10 siblings, 0 replies; 12+ messages in thread From: ralf_corsepius at rtems dot org @ 2004-10-17 20:07 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From ralf_corsepius at rtems dot org 2004-10-17 20:07 ------- (In reply to comment #7) > *** Bug 18039 has been marked as a duplicate of this bug. *** I can confirm that the bug I had reported in PR 18039, does not occur anymore with today's GCC from gcc-3.4-branc (version 3.4.3 20041017 (prerelease)). -- 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).