https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119460
--- Comment #10 from Paul Thomas <pault at gcc dot gnu.org> ---
Thanks for all your investigations into this and pr119540. Compiling with -m32
to trigger the bug was something that I should have thought of myself :-(
Thanks!
> Why is dim /= NULL?
I don't know. I have tried all manner of changes to the declaration in
intrinsic.cc and the prototypes in reduce.c. I even tried changing the wrapper
to an integer, kind=4 function to no avail.
This fails in the same way.
! Compile with -m32
program test_reduce
implicit none
integer :: i
real(16) :: rvec(2), rres0
rvec = [1.0, 2.0]
rres0 = reduce (rvec, add)
if (abs (rres0 - 3.0) > 1e-6) stop
contains
pure real(16) function add (i, j)
real(16), intent(in) :: i, j
add = i + j
end function add
end
See the next comment and attachment for a rather desperate attempt to
understand what is happening.
Paul