So far I found the following errors removed:
- - when one appends constant string to string with '+' operator compiler forgets to add terminator,
- linker may introduce bank switching instruction without checking whether previous bit testing instruction may skip over it,
- division by a constant being a power of 2 is optimized to right shifting which produces errors for negative dividends (-3/2 gives -2!) for all signed types (short, integer, longint) when dividend is not a multiple of divisor,
- modulo operations with power of 2 (x mod 2^n) are optimized to 'AND' operations with wrong parameters (for bytes higher then least significant one),
- negation of HiWord, LoWord applied to a constant produces wrong results for some arguments (like not HiWord($00FF0000)=$0000),
- letting compiler extend type in expression may lead to incorrect results (PIC16 & enhanced only).
To avoid accusation of being uncharacteristically pleasant , I have to add that the compiler became slightly over-aggressive in replacing local variables, which sometimes leads to marginally bigger code and RAM use. Local variables are being replaced by hidden ones - not compiler's internal ones, which would be understandable and saved RAM, but by new variables that use the same amount of space or more. Here's an example:
Code: Select all
older compiler version v 7.00
____________________________________________________________________________________
;S547.mpas,534 :: tempw:=time/60; ;S547.mpas,534 :: tempw:=time/60;
MOVLW 60 MOVLW 60
MOVWF R4 MOVWF R4
MOVLW 0 MOVLW 0
MOVWF R5 MOVWF R5
MOVWF R6 MOVWF R6
MOVWF R7 MOVWF R7
MOVFF FARG_showTime_time, R0 MOVFF FARG_showTime_time, R0
MOVFF FARG_showTime_time+1, R1 MOVFF FARG_showTime_time+1, R1
MOVFF FARG_showTime_time+2, R2 MOVFF FARG_showTime_time+2, R2
MOVFF FARG_showTime_time+3, R3 MOVFF FARG_showTime_time+3, R3
CALL _Div_32x32_U, 0 CALL _Div_32x32_U, 0
MOVFF R0, showTime_tempw MOVFF R0, FLOC__showTime
MOVFF R1, showTime_tempw+1 MOVFF R1, FLOC__showTime+1
MOVFF R2, FLOC__showTime+2 \ superfluous
MOVFF R3, FLOC__showTime+3 /
;S547.mpas,535 :: time:=time-60*tempw;
MOVLW 0 MOVLW 60 | not optimal
MOVWF R2 MOVWF R0
MOVWF R3 MOVLW 0
MOVLW 60 MOVWF R1
MOVWF R4 MOVWF R2
MOVLW 0 MOVWF R3
MOVWF R5 MOVFF FLOC__showTime, R4
MOVWF R6 MOVFF FLOC__showTime+1, R5
MOVWF R7 MOVLW 0
CALL _Mul_32x32_U, 0 MOVWF R6
MOVWF R7
CALL _Mul_32x32_U, 0
;S547.mpas,535 :: time:=time-60*tempw;
I cannot write much about the IDE - after discovering quirks that make its use too cumbersome for me, I reverted to IDE from v6.61 and didn't continue testing the new version. The other reason that I stayed with older version is malfunction of Package Manager that makes restoring previously installed library packages impossible. Hopefully, these issues will be soon fixed by a minor revision that will not require full installation and release of new version of Package Manager.
IDE quirks that made me revert to older IDE:
- in Output Settings: 'Include sorce lines in output files', 'Generate COFF file', and 'Long HEX format' are always cleared on start-up
- in Editor Settings: 'Show Indent Guides' option always starts unchecked and one cannot turn it on without first checking 'Enable code folding' ('Allow wildcard character' always starts checked but that's no bother).
BTW, there's now an option to switch off automatic appearance of Code Assistant window. Unfortunately, one cannot then invoke Code Assistant manually either.