Bug 20858 - NULL doesn't get its argument type (kind)
Summary: NULL doesn't get its argument type (kind)
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.1.0
: P2 normal
Target Milestone: 4.1.0
Assignee: Not yet assigned to anyone
URL:
Keywords: accepts-invalid
Depends on:
Blocks: 25051
  Show dependency treegraph
 
Reported: 2005-04-08 15:55 UTC by Joost VandeVondele
Modified: 2006-02-10 20:10 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-12-31 20:08:45


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joost VandeVondele 2005-04-08 15:55:03 UTC
The following is non-standard and the compiler should probably generate a
warning/error with '-pedantic -std=f95'

INTEGER, POINTER :: I
REAL, POINTER :: A
A=>NULL(I)
END
Comment 1 Francois-Xavier Coudert 2005-04-10 08:48:17 UTC
Intel says "The type of the target is different from the pointer". Confirmed.
Comment 2 Tobias Schlüter 2005-04-22 14:33:38 UTC
Are there any circumstances where the argument to NULL has any meaning, besides
making a program invalid?
Comment 3 Joost VandeVondele 2005-04-23 13:47:04 UTC
(In reply to comment #2)
> Are there any circumstances where the argument to NULL has any meaning, 
besides
> making a program invalid?

PR21177
Comment 4 kargls 2006-02-10 19:01:09 UTC
Subject: Bug 20858

Author: kargl
Date: Fri Feb 10 19:01:05 2006
New Revision: 110845

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=110845
Log:
2006-02-05  Steven G. Kargl  <kargls@comcast.net>

PR fortran/20858
*decl.c (variable_decl): Improve error message.  Remove initialization
 typespec.  Wrap long line.
*expr.c (gfc_check_pointer_assign): Permit checking of type, kind type,
 and rank.
*simplify.c (gfc_simplify_null): Ensure type, kind type, and rank are set.

gfortran.dg/null_1.f90: New test.


Added:
    trunk/gcc/testsuite/gfortran.dg/null_1.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/decl.c
    trunk/gcc/fortran/expr.c
    trunk/gcc/fortran/simplify.c
    trunk/gcc/testsuite/ChangeLog

Comment 5 kargls 2006-02-10 20:09:44 UTC
Subject: Bug 20858

Author: kargl
Date: Fri Feb 10 20:09:41 2006
New Revision: 110848

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=110848
Log:
2006-02-10  Steven G. Kargl  <kargls@comcast.net>

        PR fortran/20858
        *decl.c (variable_decl): Improve error message.  Remove initialization
        typespec.  Wrap long line.
        *expr.c (gfc_check_pointer_assign): Permit checking of type, kind type,
        and rank.
        *simplify.c (gfc_simplify_null): Ensure type, kind type, and rank
        are set.

2006-02-10  Steven G. Kargl  <kargls@comcast.net>
        
	PR fortran/20858
        gfortran.dg/null_1.f90: New test.


Added:
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/null_1.f90
Modified:
    branches/gcc-4_1-branch/gcc/fortran/ChangeLog
    branches/gcc-4_1-branch/gcc/fortran/decl.c
    branches/gcc-4_1-branch/gcc/fortran/expr.c
    branches/gcc-4_1-branch/gcc/fortran/simplify.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog

Comment 6 kargls 2006-02-10 20:10:37 UTC
Fixed on 4.1 and trunk.