1

Consider the following ANSI C code segment: Assume that the variable y points to a struct (allocated on the heap) containing two fields f1 and f2, and the local variables x, y, z, p, q, and i are allotted registers. Common sub-expression elimination (CSE) optimization is applied on the code. The number of addition and the dereference operations (of the form y ->f1 or y ->f2) in the optimized code, respectively, are:

Correct Answer: 303 and 2

Make the most of this question

This page focuses on one C Programming MCQs question from Programming. After checking the answer, return to the topic list to practice more or run a timed set.

C Programming MCQs MCQ: Consider the following ANSI C code segment: Assume that the variable y points to a struct (allocated on the heap) containing two fields f1 and f2, and the local variables x, y, z, p, q, and i are allotted registers. Common sub-expression elimination (CSE) optimization is applied on the code. The number of addition and the dereference operations (of the form y ->f1 or y ->f2) in the optimized code, respectively, are: | Extra Education