User account creation filtered due to spam.

Bug 53668 - Cray-pointer diagnostic enhancement
Summary: Cray-pointer diagnostic enhancement
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.8.0
: P3 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2012-06-14 09:07 UTC by Tobias Burnus
Modified: 2015-08-28 20:52 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2015-08-28 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Burnus 2012-06-14 09:07:49 UTC
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)
 end
!contains
  subroutine f(p)
    pointer (p, i)
    integer :: i
  end subroutine f
!end
Comment 1 Francois-Xavier Coudert 2015-08-28 20:47:15 UTC
Author: fxcoudert
Date: Fri Aug 28 20:46:43 2015
New Revision: 227311

URL: https://gcc.gnu.org/viewcvs?rev=227311&root=gcc&view=rev
Log:
	PR fortran/53668

	* intrinsic.c (add_functions, add_subroutines): Remove resolution
	functions for FREE and MALLOC.
	* intrinsic.h (gfc_resolve_malloc, gfc_resolve_free): Remove.
	* iresolve.c (gfc_resolve_malloc, gfc_resolve_free): Remove.
	* trans-intrinsic.c (conv_intrinsic_free,
	gfc_conv_intrinsic_malloc): New functions.

	* intrinsics/malloc.c: Adapt comments.

Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/intrinsic.c
    trunk/gcc/fortran/intrinsic.h
    trunk/gcc/fortran/iresolve.c
    trunk/gcc/fortran/trans-intrinsic.c
    trunk/libgfortran/ChangeLog
    trunk/libgfortran/intrinsics/malloc.c