[Bug fortran/53668] New: Do some Cray-pointer fixes

burnus at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Jun 14 09:08:00 GMT 2012


             Bug #: 53668
           Summary: Do some Cray-pointer fixes
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Keywords: diagnostic, missed-optimization
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org

Based on PR 53667.

a) Currently, FREE() and MALLOC() call via iresolve.c the
libgfortran/intrinsic/malloc.c's functions. One should call the builtins
instead - the library doesn't do anything different.

b) Passing an integer to a Cray pointer dummy should print a warning - both
when the explicit interface is known as well as via gsym.

Cray prints an error: 'The type of the actual argument, "INTEGER", does not
match "Cray pointer", the type of the dummy argument.'

But probably printing a warning is better - as the tricks in PR 53667 show:
Better to have an integer to a Cray pointer dummy than an integer dummy with an
address, which is only later converted to a Cray pointer.

! Compile with: -fcray-pointer
use iso_c_binding
implicit none
integer(c_intptr_t) :: intptr
call f(intptr)
  subroutine f(p)
    pointer (p, i)
    integer :: i
  end subroutine f

More information about the Gcc-bugs mailing list