Bug 25423 - Error with nested where statements
Summary: Error with nested where statements
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: 4.1.0
Assignee: Not yet assigned to anyone
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2005-12-15 02:11 UTC by Erik Schnetter
Modified: 2006-01-01 05:29 UTC (History)
2 users (show)

See Also:
Host: powerpc-apple-darwin8.3.0
Target: powerpc-apple-darwin8.3.0
Build: powerpc-apple-darwin8.3.0
Known to work:
Known to fail:
Last reconfirmed: 2005-12-15 04:45:06


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Schnetter 2005-12-15 02:11:42 UTC
The source code

subroutine sub (i, j)
  implicit none
  logical i(10), j(10)
  where (i)
     where (j)
     end where
  end where
end subroutine sub

leads to the error message

$ ~/gcc/bin/gfortran -c where.f90 
 In file where.f90:6

     end where
             1
Error: Unsupported statement inside WHERE at (1)

when compiled with

$ ~/gcc/bin/gfortran --version
GNU Fortran 95 (GCC) 4.2.0 20051129 (experimental)



The end where statement should not lead to an error message; end where statements are allowed in where clauses.
Comment 1 Andrew Pinski 2005-12-15 04:45:06 UTC
Confirmed.
Comment 2 eedelman 2005-12-20 21:26:34 UTC
Working on a patch.
Comment 3 eedelman 2005-12-21 11:58:12 UTC
Subject: Bug 25423

Author: eedelman
Date: Wed Dec 21 11:58:09 2005
New Revision: 108902

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=108902
Log:
fortran/
2005-12-21  Erik Edelmann  <eedelman@gcc.gnu.org>

        PR fortran/25423
        * parse.c (parse_where_block): break instead of "fall
         through" after parsing nested WHERE construct.


testsuite/
2005-12-21  Erik Edelmann  <eedelman@gcc.gnu.org>

        PR fortran/25423
        gfortran.dg/where_nested_1.f90: New.


Added:
    trunk/gcc/testsuite/gfortran.dg/where_nested_1.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/parse.c
    trunk/gcc/testsuite/ChangeLog

Comment 4 eedelman 2005-12-21 12:08:03 UTC
Subject: Bug 25423

Author: eedelman
Date: Wed Dec 21 12:07:58 2005
New Revision: 108903

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=108903
Log:
fortran/
2005-12-21  Erik Edelmann  <eedelman@gcc.gnu.org>

        PR fortran/25423
        * parse.c (parse_where_block): break instead of "fall
        through" after parsing nested WHERE construct.

testsuite/
2005-12-21  Erik Edelmann  <eedelman@gcc.gnu.org>

        PR fortran/25423
        gfortran.dg/where_nested_1.f90: New.


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

Comment 5 eedelman 2005-12-21 12:12:55 UTC
Subject: Bug 25423

Author: eedelman
Date: Wed Dec 21 12:12:52 2005
New Revision: 108904

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=108904
Log:
fortran/
2005-12-21  Erik Edelmann  <eedelman@gcc.gnu.org>

        PR fortran/25423
        * parse.c (parse_where_block): break instead of "fall
        through" after parsing nested WHERE construct.

testsuite/
2005-12-21  Erik Edelmann  <eedelman@gcc.gnu.org>

        PR fortran/25423
        gfortran.dg/where_nested_1.f90: New.


Added:
    branches/gcc-4_0-branch/gcc/testsuite/gfortran.dg/where_nested_1.f90
Modified:
    branches/gcc-4_0-branch/gcc/fortran/ChangeLog
    branches/gcc-4_0-branch/gcc/fortran/parse.c
    branches/gcc-4_0-branch/gcc/testsuite/ChangeLog

Comment 6 eedelman 2005-12-21 16:17:37 UTC
Fixed on trunk, 4.1 and 4.0