Compiler Gurus,
I am working on a microcode project where register allocation is done
by the programmer. There is nothing which prevents the programmer from
allocating two or more variables to the same register and then
inadvertently writing code with overlapping live ranges for those
variables. The microcode assembler trusts the register allocation and
this results in (numerous) bugs which are difficult to find.
I can easily convert the code into a reprentation like that
below. Basically I can represent the writing and reading of variables
and the branching of the code. What I am looking for is a tool which
will do an analysis and re****t the set of variables which are live at
every point in the code. I can then use process this to determine that
for each set of live variables there are unique registers allocated.
I am not looking to build a compiler (or modify one) and do the
register allocation, I am just looking for something "simple" to take
a representation and give me a detailed re****t on variable live
ranges.
Any advice or pointers would be greatly appreciated.
Sample representation for analysis tool:
label_1:
write a;
write b;
label_2:
read a;
write c;
nway_branch label_3 label_5 label_8;
label_3:
.
.
.