Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Run-time, Compile-time (are the statements in green correct?) For each of the fo

ID: 3571455 • Letter: R

Question

Run-time, Compile-time (are the statements in green correct?)

For each of the following actions, state whether it happens at: compiler construction time (i.e., when developing the compiler) compile time (i.e., when compiling or linking a program) run-time (i.e. when executing the code generated by the compiler) For example, evaluating an arithmetic expression will mostly occur at run-time (but can occur at compile time if all operands have known constant values). Consider only normal scenarios for these actions. Compute address of a local variable. This happens at run-time. This is the only time where a variable is finally being used and assigned its place in the stack, for example. Elimination of a common sub-expression. This happens at compile-time. Here is where optimization will become handy. Choose in which area of memory (static data, heap, or stack) a variable will be stored. This takes place at run-time.

Explanation / Answer

All you wrote are correct.

a. Address is assigned only when the program data is loaded into memory during runtime.

b. elimination of common sub expression is a technique used in the optimization phase of a compiler during compile time.

c. During runtime memory area is decided to store a variable.