[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
AW: [avr-gcc-list] Horrible code
From: |
Haase Bjoern (PT-BEU/EMT) |
Subject: |
AW: [avr-gcc-list] Horrible code |
Date: |
Wed, 17 May 2006 09:14:50 +0200 |
...probably the 4.1 mid-end generates slightly different RTL, so that the
present combine patterns of gcc that identify possible uses of the sbrs/jmp
instruction sequence are no longer triggered. No catastrophe. It should be easy
to fix. Could you file a gcc bug report and mark the bug as "missing
optimization" and 4.1 regression, so that it's not forgotten?
Bjoern.
-----Ursprüngliche Nachricht-----
Von: address@hidden [mailto:address@hidden Im Auftrag von James L. Evans
Gesendet: Mittwoch, 17. Mai 2006 00:47
An: address@hidden
Betreff: [avr-gcc-list] Horrible code
Could someone with a 4.1 version of the AVR-GCC compiler please compile
the following code (-Os) and see if it generates better code than the
horrible code (25 instructions) generated for Case 2 by version 3.4.3?
Thanks,
Jim Evans
#include <inttypes.h>
#include <avr/io.h>
void test7(void) {
while (PINA & 0x40) PORTA = 0; // Case 1
while ((PINA & 0x40) == 0) PORTA = 0; // Case 2
while (!(PINA & 0x40)) PORTA = 0; // Case 3
uint8_t b;
while ((b = (PINA & 0x40)) == 0) PORTA = 0; // Case 4
}
_______________________________________________
AVR-GCC-list mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- AW: [avr-gcc-list] Horrible code,
Haase Bjoern (PT-BEU/EMT) <=