Summary: | [3.4 Regression] [fweb related] bug while initialising variables | ||
---|---|---|---|
Product: | gcc | Reporter: | Emil <em> |
Component: | target | Assignee: | denisc |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | denisc, eric.weddington, gcc-bugs, giovannibajo, jurij.kotar, ralf_corsepius |
Priority: | P2 | Keywords: | wrong-code |
Version: | 3.4.0 | ||
Target Milestone: | 3.4.3 | ||
Host: | Target: | avr-elf | |
Build: | Known to work: | 3.3.2 | |
Known to fail: | 3.4.0 | Last reconfirmed: | 2004-09-03 01:19:27 |
Description
Emil
2004-08-05 01:27:40 UTC
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 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 *** Bug 17602 has been marked as a duplicate of this bug. *** Denis, would you please backport the patch to the 3.4 branch so that we can close this PR? Thanks. 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 Fixed. *** Bug 18039 has been marked as a duplicate of this bug. *** (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)). |