Bug 42936 - Result of passing NULL() as actual arg doesn't inherit characteristics from the corresponding dummy arg
Summary: Result of passing NULL() as actual arg doesn't inherit characteristics from t...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.5.0
: P3 normal
Target Milestone: 4.5.0
Assignee: Tobias Burnus
URL:
Keywords: rejects-valid
Depends on:
Blocks: 32834
  Show dependency treegraph
 
Reported: 2010-02-02 11:00 UTC by Mat Cross
Modified: 2010-02-07 02:21 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2010-02-02 17:22:14


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mat Cross 2010-02-02 11:00:03 UTC
> gfortran --version
GNU Fortran (GCC) 4.5.0 20100128 (experimental)
Copyright (C) 2010 Free Software Foundation, Inc.

GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING

> cat null.f90
SUBROUTINE PASSES_NULL
  INTERFACE
     SUBROUTINE SUB(I)
       INTEGER, POINTER :: I(:,:,:)
     END SUBROUTINE SUB
  END INTERFACE
  CALL SUB(NULL())
END SUBROUTINE PASSES_NULL

> gfortran -c null.f90
null.f90:7.11:

  CALL SUB(NULL())
           1
Error: Rank mismatch in argument 'i' at (1) (3 and 0)

> nagfor -c null.f90
NAG Fortran Compiler Release 5.2(703)
[NAG Fortran Compiler normal termination]
Comment 1 Tobias Burnus 2010-02-02 12:58:06 UTC
Confirmed (no regression).
Comment 2 Tobias Burnus 2010-02-02 17:22:14 UTC
Patch: http://gcc.gnu.org/ml/fortran/2010-02/msg00014.html
Comment 3 Tobias Burnus 2010-02-03 08:26:20 UTC
Subject: Bug 42936

Author: burnus
Date: Wed Feb  3 08:26:08 2010
New Revision: 156461

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=156461
Log:
2010-02-03  Tobias Burnus  <burnus@net-b.de>

        PR fortran/42936
        * interface.c (compare_parameter): Disable rank-checking
        for NULL().

2010-02-03  Tobias Burnus  <burnus@net-b.de>

        PR fortran/42936
        * gfortran.dg/null_4.f90: New test.


Added:
    trunk/gcc/testsuite/gfortran.dg/null_4.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/interface.c
    trunk/gcc/testsuite/ChangeLog

Comment 4 Tobias Burnus 2010-02-03 08:26:49 UTC
FIXED on the trunk (for 4.5.0). Thanks for the report!