Menu

#2561 Unsigned char at location treated as 16bit

open
nobody
None
PIC14
5
2023-01-03
2016-11-07
No

It seems that specifying a location with __at implicitely makes an unsigned char 16bit at least as far as the compiler is concerned.

sdcc -mpic14 -p16f1718 --use-non-free -Wl-C bug01.c

SDCC : mcs51/z80/z180/r2k/r3ka/gbz80/tlcs90/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8 3.6.0 #9615 (Linux)

1 Attachments

Discussion

  • Herbert Pötzl

    Herbert Pötzl - 2016-11-07

    The resulting assembler output.

     
  • Tom Li

    Tom Li - 2023-01-03

    I can no longer reproduce this bug from the current trunk.

    The old buggy assembly output was:

    ;   .line   31; "bug01.c"   if (at0x220) {
        BANKSEL _at0x220
        MOVF    (_at0x220 + 0),W
        IORWF   (_at0x220 + 1),W
        BTFSC   STATUS,2
        GOTO    _00106_DS_
    

    And now the new assembly output is:

    ;   .line   33; "bug01.c"   if (at0x220) {
        MOVLW   (_at0x220 + 0)
        BANKSEL r0x1001
        MOVWF   r0x1001
        MOVF    r0x1001,W
        BTFSC   STATUS,2
        GOTO    _00106_DS_
    

    This bug should be closed.

     

    Last edit: Tom Li 2023-01-03
    • Benedikt Freisen

      But why can it no longer be reproduced?
      Could this have been fixed by [r11427] ("Merge pic14 branch.") in 2019?

       

Log in to post a comment.