static __data volatile unsigned char __at(0x0200) volatileBits;
generates a dusplicate symbol:
udata_test_0 udata
_volatileBits res 1
ustat_test_00 udata 0X0200
_volatileBits res 1
which fails to assemble:
test.asm:21:Error[116] Address label duplicated or different in second pass: "_volatileBits"
test.asm:21:Error[115] Duplicate label or redefining symbol that cannot be redefined: "_volatileBits"
This issue is the root cause for the PIC16 bitfields-* regression failures where vartype is 5 or 6.
Hi Gabriele,
I reproduced the duplicate-symbol issue reported in #4275 using the official SVN r17255 sources.
The root cause is in pic16emitRegularMap()
` insrc/pic16/glue.c`.Static variables with absolute addresses are incorrectly added to
pic16_rel_udatabefore being handled by the absolute-address allocation logic. This results in duplicate assembler symbol definitions.The attached patch adds a single condition:
&& !SPEC_ABSA(sym->etype)
This prevents absolute-addressed static variables from entering the regular UDATA allocation path.
Validation results (SVN r17255, PIC16):
bitfields-checks, varType=5, struct=0/1: 2/2 PASS.bitfields-checks, varType=6, struct=0/1: 2/2 PASS.0x0200and0x0204.All four bitfield variants compiled successfully with SDCC and assembled successfully with GPUTILS r1333.
The patch modifies only src/pic16/glue.c
.Runtime regression tests have not yet been performed.
Attached:
4275_pic16_absolute_static.patchBest regards
Thanks for the patch!
fixed in [r17287]
Related
Commit: [r17287]