• retagged by
1,689 views
0 0 votes

1 Answer

Best answer
3 3 votes
Live variable means those which will be used again- not necessarily by same block.

int a = 5;
if(a < b)
{
   b = 7;
}
c = a;

Here the statements inside the if are in a separate basic block and a is live there because a is used again though in a different block. Compiler use live variable analysis to see for which all variables it can free the registers.
• selected by
Position:
Show:

Related questions

1 1 vote
1 answers 1 answer
2.7k
2.7k views
palashbehra5 asked Jan 11, 2022
2,720 views
A variable v is live at a program point p if some path from p to program exit contains an r-value occurrence of v which is not preceded by an l-value occurrence of v . Th...
1 1 vote
1 1 answer
2.5k
2.5k views
Na462 asked Jun 11, 2018
2,484 views
Need to tell the Variables live at the Shown points. And Please explain because I know how to identify but I am little confused in applying the concept.Thank you
1 1 vote
1 1 answer
953
953 views
santhoshdevulapally asked Jan 4, 2017
953 views
What is live variable and dead code elimination.please explain with example each