Problem
The PIC14 backend may generate calls to generic pointer helper routines (__gptrget1 and __gptrput1) without explicitly selecting the pseudo-stack bank immediately before the call.
On enhanced PIC14 devices, this may result in incorrect memory accesses if BSR selects a different bank.
Fix
The patch modifies src/pic14/gen.c to emit BANKSEL STK00 before the affected generic pointer helper calls.
Validation
Tested with SDCC r17110 targeting PIC16F1939.
This confirms that the GPOINTER fix does not depend on the BANKOPT change for the tested scenario.
The patch is based on SVN r17110.
Additional validation on classic mid-range PIC14:
The GPOINTER BSR patch was also tested on PIC16F877A using SDCC r17110, with only the
gen.cfix applied and without the separate BANKOPT patch.The test compiled and linked successfully, and simulation confirmed correct generic pointer operations (9/9 PASS).
The patch has now been validated on both PIC16F1939 (enhanced mid-range) and PIC16F877A (classic mid-range).