https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122206
anlauf at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work| |7.5.0
Status|UNCONFIRMED |NEW
Last reconfirmed| |2025-10-08
Ever confirmed|0 |1
Known to fail| |15.2.0, 16.0, 8.5.0
--- Comment #4 from anlauf at gcc dot gnu.org ---
Inspired by Steve's comment I tried to find a Fortran-only testcase.
module test_example
implicit none
interface
function simple_interface (arg1, arg2) result(res)
real, value :: arg1, arg2
real :: res
end function
end interface
procedure(simple_interface) :: simple_function
contains
subroutine test_example_interface
implicit none
real :: arg, val1, arg2, val2
arg = 42.; arg2 = arg
val1 = simple_function(arg,arg2)
val2 = simple_function(arg,arg2)
print *, val1, val2
arg = 23.; arg2 = arg
val1 = simple_interface(arg,arg2)
val2 = simple_interface(arg,arg2)
print *, val1, val2
end subroutine test_example_interface
end module test_example
program tester
use test_example
implicit none
call test_example_interface()
end program tester
function simple_interface (x,y) result (res)
real, value :: x,y
real :: res
res = max(x,y)
end function simple_interface
function simple_function (x,y) result (res)
real, value :: x,y
real :: res
res = max(x,y)
end function simple_function
In fact this fails here on x86 when compiled with -m32:
42.0000000 NaN
23.0000000 23.0000000
Studying the tree-dump, I see that this is a regression since gcc-8.
My gcc-7.5.0 still works fine.