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?
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here