Bug 29393 - Vector subscript rejected
Summary: Vector subscript rejected
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: 4.1.2
Assignee: eedelman
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2006-10-08 21:31 UTC by Francois-Xavier Coudert
Modified: 2006-10-24 22:51 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-10-21 19:26:52


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Francois-Xavier Coudert 2006-10-08 21:31:07 UTC
$ cat a2.f90 
  integer, parameter ::   A(-3:7,2)=0 
  integer, parameter, dimension(3) :: V = (/ 2, 4, 6 /) 
  integer, parameter, dimension(3) :: B = A(V,1) 
END 
$ gfortran a2.f90        
 In file a2.f90:3

  integer, parameter, dimension(3) :: B = A(V,1) 
                                      1
Error: Incompatible ranks 1 and 2 in assignment at (1)
Comment 1 eedelman 2006-10-24 17:01:46 UTC
Subject: Bug 29393

Author: eedelman
Date: Tue Oct 24 17:01:30 2006
New Revision: 118008

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=118008
Log:
fortran/
2006-10-24  Erik Edelmann  <eedelman@gcc.gnu.org>

        PR fortran/29393
        * expr.c (simplify_parameter_variable): Keep rank of original
         expression.

Testsuite/
2006-10-24  Erik Edelmann  <eedelman@gcc.gnu.org>

        PR fortran/29393
        * gfortran.dg/initialize_2.f90: New.


Added:
    trunk/gcc/testsuite/gfortran.dg/initialization_2.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/expr.c
    trunk/gcc/testsuite/ChangeLog

Comment 2 eedelman 2006-10-24 20:40:29 UTC
Subject: Bug 29393

Author: eedelman
Date: Tue Oct 24 20:40:19 2006
New Revision: 118010

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=118010
Log:
fortran/
2006-10-24  Erik Edelmann  <eedelman@gcc.gnu.org>

        PR fortran/29393
        * expr.c (simplify_parameter_variable): Keep rank of original
        expression.

testsuite/
2006-10-24  Erik Edelmann  <eedelman@gcc.gnu.org>

        PR fortran/29393
        * gfortran.dg/initialize_2.f90: New.


Added:
    branches/gcc-4_2-branch/gcc/testsuite/gfortran.dg/initialization_2.f90
Modified:
    branches/gcc-4_2-branch/gcc/fortran/ChangeLog
    branches/gcc-4_2-branch/gcc/fortran/expr.c
    branches/gcc-4_2-branch/gcc/testsuite/ChangeLog

Comment 3 eedelman 2006-10-24 20:45:44 UTC
Subject: Bug 29393

Author: eedelman
Date: Tue Oct 24 20:45:29 2006
New Revision: 118011

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=118011
Log:
fortran/
2006-10-24  Erik Edelmann  <eedelman@gcc.gnu.org>

        PR fortran/29393
        * expr.c (simplify_parameter_variable): Keep rank of original
        expression.

testsuite/
2006-10-24  Erik Edelmann  <eedelman@gcc.gnu.org>

        PR fortran/29393
        * gfortran.dg/initialize_2.f90: New.


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

Comment 4 Francois-Xavier Coudert 2006-10-24 22:51:38 UTC
Fixed.