Suppose you are given the job of checking that a C compiler generates the proper code for

Question:

Suppose you are given the job of checking that a C compiler generates the proper code for structure and union access. You write the following structure declaration:

typedef union { struct { long u; short v; char W; } t1; struct { } int a [2]; char *p: } t2; } u_type; You

with different access expressions expr and with destination data type type set according to type associated with expr. You then examine the code generated when compiling the functions to see if they match your expectations.

Suppose in these functions that up and dest are loaded into registers %rdi and %rsi, respectively. Fill in the following table with data type type and sequences of one to three instructions to compute the expression and store the result at dest.

expr up->t1.u up->t1.v &up->t1.w up->t2.a up->t2.a [up->t1.u] *up->t2.p type long Code movq (%rdi), %rax movq

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Computer Systems A Programmers Perspective

ISBN: 9781292101767

3rd Global Edition

Authors: Randal E. Bryant, David R. O'Hallaron

Question Posted: