Bug 39864 - [4.5 Regression] INTRINSIC :: RESHAPE causes spurious error
Summary: [4.5 Regression] INTRINSIC :: RESHAPE causes spurious error
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: janus
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2009-04-23 12:23 UTC by Michael Richmond
Modified: 2009-04-24 08:39 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2009-04-23 20:21:17


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Richmond 2009-04-23 12:23:09 UTC
When I attempt to compile the following function using http://users.physik.fu-berlin.de/~tburnus/gcc-trunk/gcc-trunk-x86_64.tar.gz

FUNCTION next_state()
INTRINSIC :: RESHAPE
INTEGER, PARAMETER :: trantb(1,1) = RESHAPE((/1,2/), shape=(/1,1/))
next_state = trantb(1, 1)
END FUNCTION next_state

I get the message:

test161.f90:3.67:

INTEGER, PARAMETER :: trantb(1,1) = RESHAPE((/1,2/), shape=(/1,1/))
                                                                   1
Error: Symbol at (1) is not a DUMMY variable
test161.f90:3.67:

INTEGER, PARAMETER :: trantb(1,1) = RESHAPE((/1,2/), shape=(/1,1/))
                                                                   1
Error: Symbol at (1) is not a DUMMY variable

The problem goes away if I remove "INTRINSIC :: RESHAPE"
Comment 1 Tobias Burnus 2009-04-23 12:49:54 UTC
Janus, can you have a look? It looks like another fallout of your patch. If it is not fixable quickly, we should consider backing it out until we have a working version.
Comment 2 janus 2009-04-23 20:21:17 UTC
> Janus, can you have a look? It looks like another fallout of your patch.

Indeed, it is.


> If it is not fixable quickly, we should consider backing it out 
> until we have a working version.

The fix is quite trivial, I'll post a patch for this and PR39861 in a minute.
I really wonder why these things have not been caught by the testsuite.
Comment 3 janus 2009-04-24 08:34:35 UTC
Subject: Bug 39864

Author: janus
Date: Fri Apr 24 08:34:14 2009
New Revision: 146677

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=146677
Log:
2009-04-24  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/39861
	PR fortran/39864
	* symbol.c (gfc_copy_formal_args_intr): Set attr.flavor and attr.dummy
	for the formal arguments.


2009-04-24  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/39861
	PR fortran/39864
	* gfortran.dg/intrinsic_1.f90: New.


Added:
    trunk/gcc/testsuite/gfortran.dg/intrinsic_1.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/symbol.c
    trunk/gcc/testsuite/ChangeLog

Comment 4 janus 2009-04-24 08:39:41 UTC
Fixed by r146677. Closing.