|
From: | Richard F |
Subject: | [avr-gcc-list] compiler bug? |
Date: | Tue, 10 Feb 2009 11:45:52 +0000 |
User-agent: | Thunderbird 2.0.0.19 (Windows/20081209) |
Hi Call me a newbie, but is there anything wrong with the following statement? rtc.time_element.tm_wday = (rtc.time_element.tm_wday < 6) ? rtc.time_element.tm_wday++ : 0; I checked K&R and it looks OK to me. In WINAVR 20081205 the _expression_ rtc.tm_wday++ doesn't appear to be evaluated. The assembler looks like: rtc.time_element.tm_wday = (rtc.time_element.tm_wday < 6) ? rtc.time_element.tm_wday++ : 0; 1ca: 80 91 77 01 lds r24, 0x0177 1ce: 86 30 cpi r24, 0x06 ; 6 1d0: 08 f0 brcs .+2 ; 0x1d4 <rt_clock+0x42> 1d2: 80 e0 ldi r24, 0x00 ; 0 1d4: 80 93 77 01 sts 0x0177, r24 Thanks |
[Prev in Thread] | Current Thread | [Next in Thread] |