ps7 - 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 reaching definition 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: y = x + 2; 7: goto L3 L2 8: y = x + 1; 9: x = x + 1; L3 10: x = x + 1; 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 uninitialized values. A common error in programs is using a variable that has not yet been defined. Write an analysis that can detect any use of a variable that has not been defined. Do this by tracking, for each variable in a program, whether it is currently defined or not. Hint: think about how this analysis relates to a reaching definition analysis.or not....
View Full Document

This note was uploaded on 02/19/2012 for the course ECE 468 taught by Professor Test during the Fall '08 term at Purdue University-West Lafayette.

Page1 / 2

ps7 - 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