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
Our optimizer recognizes that y0 eq ... View full answer
Get step-by-step solutions from verified subject matter experts
