Data flow analysis work over a control flow graph. When a language under consideration supports exceptions, control flow graph can explode.
What are the standard techniques for dealing with this blow-up? Can we soundly disregard edges induced by exception? Data flow analyses anyhow compute over-approximations, so we would end up with a less precise but sound solution. Is this true?
Update: Here are few useful links that I was able to dig out at the end:
Asked By : bellpeace
Answered By : Gilles
Ignoring exceptions is unsound. Example:
let g = { raise E; } let f = { x := interesting_stuff(); g(); x := 0; }
When analyzing f
, you need to take into account the fact that g
raises an exception, otherwise you would incorrectly conclude that x
is always 0 on return from f
.
I don't know that there is a "standard" technique for dealing with exceptions. There's some literature on the topic, I don't have any more idea of what papers are relevant than I can find by a Google search.
Formally, exceptions can be turned into conditional statements that propagate up the call chain, which of course blows up the control flow graph. In many concrete cases, the exception case is the less interesting case, where a lot of data gets killed, so it should be handled lazily in a forward approach (no need to analyze the liveness on the exception path if the handler kills the data).
Best Answer from StackOverflow
Question Source : http://cs.stackexchange.com/questions/59832
0 comments:
Post a Comment
Let us know your responses and feedback