avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] GCC 6.1.0, strings and PROGMEM


From: Alan Burlison
Subject: [avr-gcc-list] GCC 6.1.0, strings and PROGMEM
Date: Sun, 15 May 2016 09:14:10 +0100

I've just updated my toolchain to use GCC 6.1.0 and I notice that
constant C strings seem to be being placed automatically in PROGMEM,
rather than requiring the use of the PSTR macro as in the past. This
caused me some confusion because call such as printf("foo") started
printing garbage. Here's the proof:

        printf("          ");
     91e:       84 e7           ldi     r24, 0x74       ; 116
     920:       90 e0           ldi     r25, 0x00       ; 0
     922:       9f 93           push    r25
     924:       8f 93           push    r24
     926:       0e 94 04 17     call    0x2e08  ; 0x2e08 <printf>

      74:       20 20           and     r2, r0
      76:       20 20           and     r2, r0
      78:       20 20           and     r2, r0
      7a:       20 20           and     r2, r0
      7c:       20 20           and     r2, r0
      7e:       00 21           and     r16, r0

I haven't been able to find any mention of this change anywhere. Is
this a deliberate change in gcc behaviour, or a bug?

Thanks,

-- 
Alan Burlison
--



reply via email to

[Prev in Thread] Current Thread [Next in Thread]