I am not familiar with pic ,but __sfr is already explained in the manual.
> 在 2016年1月3日,09:53,C. SB <beltoi...@email.com> 写道: > > Hi, > I was looking at the disassembly for some PIC14 code, and I assumed the SFRs > would be naturally declared as volatile. This would mean code like > **** > (void) RCREG; > (void) RCREG; > **** > would read the RCREG register twice, discarding its value. But those get > optimized away ! (tested with 2015-12-31 snapshot) > > In the non-free "pic16f628a.h" header (probably others too ?), RCREG is > defined as > **** > extern __at(0x001A) __sfr RCREG; > **** > but the __sfr keyword (applied to PIC*) is undocumented in the sdcc manual. > > Is this a bug ? Is there a workaround ? > > Thanks ! > > ------------------------------------------------------------------------------ > _______________________________________________ > Sdcc-user mailing list > Sdcc-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/sdcc-user ------------------------------------------------------------------------------ _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user