From: Erik Edelmann Date: Wed, 21 Dec 2005 11:58:09 +0000 (+0000) Subject: re PR fortran/25423 (Error with nested where statements) X-Git-Tag: releases/gcc-4.2.0~5203 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=46833406d17c0f2d88dc370118ab0d1fcf6fb2b2;p=thirdparty%2Fgcc.git re PR fortran/25423 (Error with nested where statements) fortran/ 2005-12-21 Erik Edelmann PR fortran/25423 * parse.c (parse_where_block): break instead of "fall through" after parsing nested WHERE construct. testsuite/ 2005-12-21 Erik Edelmann PR fortran/25423 gfortran.dg/where_nested_1.f90: New. From-SVN: r108902 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 8dbcc233b448..8fb73185f4a0 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2005-12-21 Erik Edelmann + + PR fortran/25423 + * parse.c (parse_where_block): break instead of "fall + through" after parsing nested WHERE construct. + 2005-12-18 Paul Thomas PR fortran/25018 diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c index f53a2e4e5c78..a0da4480b8b9 100644 --- a/gcc/fortran/parse.c +++ b/gcc/fortran/parse.c @@ -1668,7 +1668,7 @@ parse_where_block (void) case ST_WHERE_BLOCK: parse_where_block (); - /* Fall through */ + break; case ST_ASSIGNMENT: case ST_WHERE: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 090eaf863f51..2899ab208b91 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-12-21 Erik Edelmann + + PR fortran/25423 + gfortran.dg/where_nested_1.f90: New. + 2005-12-21 Kazu Hirata PR tree-optimization/25382. diff --git a/gcc/testsuite/gfortran.dg/where_nested_1.f90 b/gcc/testsuite/gfortran.dg/where_nested_1.f90 new file mode 100644 index 000000000000..c28cfcd9651b --- /dev/null +++ b/gcc/testsuite/gfortran.dg/where_nested_1.f90 @@ -0,0 +1,26 @@ +! { dg-do compile } +! PR 25423: Nested WHERE constructs. +program nested_where + + implicit none + integer :: a(4) + logical :: mask1(4) = (/.TRUE., .TRUE., .FALSE., .FALSE./), & + mask2(4) = (/.TRUE., .FALSE., .TRUE., .FALSE./) + + where (mask1) + where (mask2) + a = 1 + elsewhere + a = 2 + end where + elsewhere + where (mask2) + a = 3 + elsewhere + a = 4 + end where + end where + + print *, a + +end program nested_where