Here you can ask questions and find or give answers to organizational, academic and other questions about studying computer science.

862 questions

981 answers

1.4k comments

431 users

0 votes
In the videos arrays are regarded as constants and are therefore excluded from the read/write sets.

In the updated lecture slides they are included. Which definitions are correct for the exam? How exactly are the read and write sets for array accesses defined?

Thanks in advance!
in # Mandatory Modules Bachelor by (230 points)

1 Answer

0 votes
 
Best answer
Yes, that was a kind of a discussion for a while. On the one hand, you can argue that arrays are constants since a statement y[x1] = x2 is mapped to a store instruction sti x2,x1,y where y is a constant and thus only x1 and x2 are read and no variable is written.

On the other hand, from the viewpoint of program analysis, you may argue that y[x1] = x2 is updating the array y if you consider y not just as a base address (as done in the C programming language) and instead consider the value of variable y as being the entire array (as done in the F# programming language for instance).

So, dealing with the array is somehow a matter of taste. It does also not matter since we use that information for the dataflow analysis and that in turn is used for register allocation, and we never assign an array variable to a register (since we map array accesses to load/store instructions with the base address of y as a constant).
by (138k points)
selected by

Related questions

0 votes
1 answer
asked Jan 17, 2021 in * TF "Emb. Sys. and Rob." by ballatma (1.2k points)
0 votes
1 answer
asked Mar 28, 2021 in # Mandatory Modules Bachelor by kremenadla (380 points)
0 votes
2 answers
0 votes
1 answer
asked Mar 26, 2021 in # Mandatory Modules Bachelor by landgram (230 points)
0 votes
1 answer
asked Mar 23, 2021 in # Mandatory Modules Bachelor by kremenadla (380 points)
Imprint | Privacy Policy
...