[Bug libgomp/92305] [10 regression] libgomp.fortran/use_device_addr-1.f90 fails starting with r277606

burnus at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Nov 12 16:04:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92305

--- Comment #9 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to Tobias Burnus from comment #8)
In gdb [GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.3) 7.7.1], which is really not the
newest, I get:

(gdb) pt c_aptr
type = <data variable, no debug info>

and stepping in, gives (all variables should be unitialized, except for those
with leading underscore, which should be 1 alias .TRUE.):

test_dummies_opt_value::test_dummy_opt_val_callee_2 (aa=0,
bb=1.3262473693532952e-315, c_aptr=<error reading variable: Attempt to
dereference a generic pointer.>, 
    c_bptr=<error reading variable: Attempt to dereference a generic pointer.>,
aptr=0x3ffffffff648, bptr=0x1, _aa=.TRUE., _bb=.TRUE., _c_aptr=.FALSE.,
_c_bptr=96)

Reduced testcase is:

module test_dummies_opt_value
  use iso_c_binding
contains
  subroutine test_dummy_opt_val_call_2()
     real(c_double), target :: aa, bb
     type(c_ptr) :: c_aptr, c_bptr
     real(c_double), pointer :: aptr, bptr
     call test_dummy_opt_val_callee_2(aa, bb, c_aptr, c_bptr, aptr, bptr)
  end subroutine test_dummy_opt_val_call_2
  subroutine test_dummy_opt_val_callee_2(aa, bb, c_aptr, c_bptr, aptr, bptr)
     real(c_double), optional, value, target :: aa, bb
     type(c_ptr), optional, value :: c_aptr, c_bptr
     real(c_double), optional, pointer :: aptr, bptr
     if (.not.present(c_aptr) .or. .not.present(c_bptr)) stop 150
  end subroutine test_dummy_opt_val_callee_2
end module test_dummies_opt_value
program omp_device_addr
  use test_dummies_opt_value
  call test_dummy_opt_val_call_2()
end program omp_device_addr


More information about the Gcc-bugs mailing list