[Bug target/108778] Missing optimization with direct register access instead of structure mapping

klaus.doldinger64 at googlemail dot com gcc-bugzilla@gcc.gnu.org
Tue Feb 14 08:54:25 GMT 2023


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108778

--- Comment #2 from Wilhelm M <klaus.doldinger64 at googlemail dot com> ---
Or even simpler:

#include <avr/io.h>
#include <stdint.h>

static uint16_t g; 

int main() {
    for(uint8_t i = 0; i < 20; i++) {
        ++g;
//        VPORTA_DIR; // suppresses optimization
        VPORTA.DIR;
    }
}


More information about the Gcc-bugs mailing list