From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18726 invoked by alias); 9 Dec 2005 21:40:08 -0000 Received: (qmail 18709 invoked by uid 48); 9 Dec 2005 21:40:05 -0000 Date: Fri, 09 Dec 2005 21:40:00 -0000 Message-ID: <20051209214005.18708.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/20839] do-loop with do-construct-name needs needs end do In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "uttamp at us dot ibm dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2005-12/txt/msg00962.txt.bz2 List-Id: ------- Comment #4 from uttamp at us dot ibm dot com 2005-12-09 21:40 ------- I did build and completed the regression test. The patch in comment #3 fixes this problem (when compiled with -pedantic option) but gfortran still fails to report this as an error with -std=f95 without -pedantic. I've created a new patch where I took the Steven's patch and added GFC_STD_F95 along with pedantic check. About the error message, how about, "Construct name on END DO at %L does not match the Named DO construct", sounds? Below, I'm listing the patch for completeness. Can somebody look at it pease? Thansks, Uttam --- gcc_org/gcc/gcc/fortran/parse.c 2005-11-30 09:56:16.000000000 -0800 +++ gcc/gcc/fortran/parse.c 2005-12-09 13:33:32.000000000 -0800 @@ -23,6 +23,7 @@ Software Foundation, 51 Franklin Street, #include "config.h" #include "system.h" +#include "flags.h" #include #include "gfortran.h" #include "match.h" @@ -2057,6 +2058,10 @@ loop: break; case ST_IMPLIED_ENDDO: + if ((pedantic || GFC_STD_F95) && gfc_current_block () != NULL) + gfc_error_now + ("Construct name on END DO at %L does not match the Named DO construct", + &gfc_current_block()->declared_at); break; default: -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20839