SDCC : mcs51/z80/z180/r2k/r3ka/gbz80/tlcs90/ez80_z80/z80n/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8/pdk13/pdk14/pdk15 4.0.3 #11778 (MINGW64)
It seems some SFRs not well defined
in SDCC\non-free\include\pic14\pic12f1571.h
PWM1PR defined as:
extern __at(0x0D95) __sfr PWM1PR;
I guess it should be better to define it as:
extern __at(0x0D95) volatile unsigned short PWM1PR;
Simple test "PWM1PR = 0x1234;" at first case produce following:
MOVLW 0x34
MOVWF _PWM1PR
while second is much closer to expectations:
MOVLW 0x34
MOVWF _PWM1PR
MOVLW 0x12
MOVWF (_PWM1PR + 1)
BTW: microchip recommended way is to store low address of multibyte data at the last. Mean it should be better to store (_PWM1PR + 1) first.
Thanks for the report. However, the pic ports currently does not have a maintainer, so I don't expect it to be fixed anytime soon.