I've been using XC8 v1.34 for a while, and since v1.41 got released I upgraded to that version instead. Just for the sake of nothing-ness, I recompiled a mature project and saw that the value under "Program Used" (in dashboard) decreased by one, so I got really curious what was optimized away (both compilers used PRO-mode optimization).
I found the menu option Windows -> Debugging -> Disassembly listing in MPLAB and in there was a clean assembler code (below each C-statement) so I cut-n-paste the contents from v1.34 and v1.41 to two separate files and ran a diff. The only thing differing is the timestamp, which was weird since MPLAB says "Program space used: 142" for v1.34 and 141 for v1.41, but the disassemblies are exactly the same.
I then try with stripping all C-lines and the header from the output with:
$ grep -v '^[0-9]*\:' 134 | grep ^[0-9] > 134_2 $ grep -v '^[0-9]*\:' 141 | grep ^[0-9] > 141_2
In the stripped files are nothing but pure assembly code. So I check again:
$ wc -l *_2 139 134_2 139 141_2 278 total $ md5sum 134_2 141_2 b6aa911111d43cf5251cda7d4e871fdb 134_2 b6aa911111d43cf5251cda7d4e871fdb 141_2
I.e exactly the same code. 139 op-codes too, not 141 or 142.
Why is MPLABX reporting the wrong value?