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

--- Comment #5 from Uwe Lohmann <ul...@t-online.de> ---
The code compilation with the option -mint8 is different.

Compilation without -mint8
(avr-gcc -Os -fwhole-program -mrelax -Wall -Wextra --save-temps -mmcu=avr25
-DF_CPU=1000000 main.c -o main.elf)

cutout of attachment: main.elf-main.s_without_-mint8

main:
/* prologue: function */
/* frame size = 0 */
/* stack size = 0 */
.L__stack_usage = 0
        ldi r24,lo8(24999)
        ldi r25,hi8(24999)
1:      sbiw r24,1
        brne 1b
        rjmp .
        nop
        ldi r24,0
        ldi r25,0
/* epilogue start */
        ret


Compilation with -mint8
(avr-gcc -mint8 -Os -fwhole-program -mrelax -Wall -Wextra --save-temps
-mmcu=avr25 -DF_CPU=1000000 main.c -o main.elf)

cutout of attachment: main.elf-main.s_with_-mint8

main:
/* prologue: function */
/* frame size = 0 */
/* stack size = 0 */
.L__stack_usage = 0
        ldi r24,lo8(-96)
        ldi r25,lo8(-122)
        rcall __builtin_avr_delay_cycles
        ldi r24,0
/* epilogue start */
        ret

The same avr-gcc; the only difference is the option -mint8.

The avr-gcc was built with:
../configure --prefix=$PREFIX --target=avr --enable-languages=c,c++,lto \
--disable-nls --disable-libssp --with-dwarf2

Why the compilation with the avr-gcc results in the different outputs?

Reply via email to