Fix for XC32 v1.40.
Steps:
1. Open "C:\Program Files\Microchip\xc32\v1.40\bin\bin\gcc\pic32mx\4.8.3\cc1.exe" file with your favorite hex editor.
2. Find and replace these bytes "0F 85 CC 00 00 00 8D 44" with "
90 E9 00 00 00 00 8D 44".
3. Do same with "C:\Program Files\Microchip\xc32\v1.40\bin\bin\gcc\pic32mx\4.8.3\cc1plus.exe" and "C:\Program Files\Microchip\xc32\v1.40\bin\bin\gcc\pic32mx\4.8.3\lto1.exe" files.
4. Use latest "xclm" file from here, i.e:
xclm
int main(){
return 2;
}
Tested under Windows 10 and MPLAB X IDE v3.15.
More info:
http://www.jubatian.com/articles/turning-on-optimizations-in-microchips-xc32/Note: I used the same technique that petarp, but now:
90 = nop
E9 = jmp
00 00 00 00 = $ + 5
Cheers.