Difference: CS255Spring08Discussions (55 vs. 56)

Revision 562008-03-13 - BinBao

Line: 1 to 1
META TOPICPARENT name="CS255Spring08"

CS255/455 Spring 2008 Questions and Answers

Line: 11 to 11
 Q: Is there a standard way to handle function calls like printf, scanf or in general var-arg functions ? TREE_CHAIN can lead to variable declarations instead of a chain of arguments, and unless explicit care of those functions is taken (through string matching == printf/scanf), I think we have to resolve to SSA graph to find relevant information (name of operands of functions, especially var-arg functions). What do we do : handle them explicitly, or is there a way to do it I cannot track down (except for SSA)?

A: For the project you don't need to handle external functions other than printf/scanf. The usual solution is through special treatment. In addition, there is no use of pointer other than in scanf. Your compiler can take advantage of the property that different variables in the test programs do not alias.

Actually, from your discussion, I remember my another concern about function call: they could define global variables or arrays. I guess we need to handle them carefully??????
Q: For dead code elimination, can we assume all function calls are essential or do we need to be able to distinguish the difference between calls like "foo(a)" and "bar(&a)"?
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding URCS? Send feedback