Question: Consider the following subroutine in Fortran 77: subroutine shift(a, b, c) integer a, b, c a = b b = c end Suppose we want

Consider the following subroutine in Fortran 77:

subroutine shift(a, b, c)

integer a, b, c

a = b

b = c

end

Suppose we want to call shift(x, y, 0) but we don’t want to change the value of y. Knowing that built-up expressions are passed as temporaries, we decide to call shift(x, y+0, 0). Our code works fine at first, but then (with some compilers) fails when we enable optimization. What is going on? What might we do instead?

Step by Step Solution

3.30 Rating (159 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Our optimizer recognizes that y0 eq ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Language Pragmatics Questions!