ps5 - ECE 468 Problem Set 7: Dataflow analysis 1. Show the...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ECE 468 Problem Set 7: Dataflow analysis 1. Show the results of running a liveness analysis on the following piece of code: For each line of code, show which definitions reach that line of code by indicating the line number the definition occurred in. 1: x = 4; 2: y = 7; L1 3: if (x > c) goto L4 4: if (y > 3) goto L2 5: a = x + 1; 6: b = a + x; 7: goto L3 L2 8: a = a + x; 9: b = x + 1; L3 10: y = a + b; 11: goto L1; L4 12: halt 2. Show the results of running an available expression analysis on the code, by indicating which expressions are available at each instruction. 3. In this problem, your goal is to develop a dataflow analysis to find leaking values. A common error in programs is forgetting to free a variable that has been malloc ed. Write an analysis that can tell, at the end of a function, whether any allocations during the function may not have been freed by the end of the function. Hint: think about this analysis relationship to reaching definitions....
View Full Document

Page1 / 2

ps5 - ECE 468 Problem Set 7: Dataflow analysis 1. Show the...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online