a = 1
b = a + c
if ( d > e) then
a = 3
else
a = 4
end if
b = a + d
Searching for forward accesses from a=1 will find b = a + d (as well as the prior accesses to a. In this case, we could use the knowledge of the code structure to know that a is always written to inside the if statement regardless of the condition result, so b = a + d is never going to use the write from a=1. This is not a bug as it won't cause incorrect code generation for anything we plan to use this from, but it is over-cautious and could be improved in the future.
At the moment if we have code like:
Searching for forward accesses from
a=1
will findb = a + d
(as well as the prior accesses toa
. In this case, we could use the knowledge of the code structure to know thata
is always written to inside the if statement regardless of the condition result, sob = a + d
is never going to use the write froma=1
. This is not a bug as it won't cause incorrect code generation for anything we plan to use this from, but it is over-cautious and could be improved in the future.