https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122206
--- Comment #2 from kargls at comcast dot net ---
Code works fine if one does not use an abstract interface and simply uses
an interface statement, i.e.,
interface
function simple_function(iarg1, arg2, arg3, arg4) bind(C) result(res)
import c_double, c_int
integer(c_int), value, intent(in) :: iarg1
real(c_double), value, intent(in) :: arg2, arg3, arg4
real(c_double) :: res
end function
end interface
With the above, -fdump-tree-original produces
arg3 = 3.0e+0;
arg4 = 1.000000000000000055511151231257827021181583404541015625e-1;
iarg1 = 2;
val1 = simple_function (iarg1, arg2, arg3, arg4);
val2 = simple_function (iarg1, arg2, arg3, arg4);
With the original code, one sees
arg3 = 3.0e+0;
arg4 = 1.000000000000000055511151231257827021181583404541015625e-1;
iarg1 = 2;
val1 = simple_function (iarg1, arg2, arg3, arg4);
val2 = simple_function (&iarg1, &arg2, &arg3, &arg4);