From firstname.lastname@example.org@21:1/5 to All on Fri Sep 22 09:45:18 2017
I have retargeted LCC for my own custom designed CPU. LCC actually works quite well and I have the basis of an OS running; all compiling correctly.
Today I compiled the Dhrystone benchmark code and suddenly LCC does something very strange: it is screwing up its register allocation; overwriting values by using the same register where it shouldn't. Look at the example below:
The code is setting up 2 parameters for a multiplication. In the first block it is loading a local var into R4 and then storing it somewhere using R3 (i clobber all registers when i call a pseudo op like MULT).
However, in the second block it is loading a local var in R3, then immediately overwriting that register for the address calculation.