This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/16884] [avr-gcc] bug while initialising variables


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]