Bug 20839 - do-loop with do-construct-name needs needs end do
Summary: do-loop with do-construct-name needs needs end do
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.1.0
: P2 minor
Target Milestone: ---
Assignee: Steven Bosscher
URL:
Keywords: accepts-invalid
: 24806 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-04-08 15:50 UTC by Joost VandeVondele
Modified: 2006-06-05 10:25 UTC (History)
2 users (show)

See Also:
Host:
Target: i686-pc-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-03-05 04:01:49


Attachments
patch (534 bytes, patch)
2005-11-13 13:56 UTC, Steven Bosscher
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joost VandeVondele 2005-04-08 15:50:04 UTC
The following is non-standard and the compiler should probably generate a
warning/error with '-pedantic -std=f95'

doi: DO 111 i=1,3
111 continue ! requires END DO doi
END
Comment 1 Francois-Xavier Coudert 2005-04-09 19:08:20 UTC
Confirmed and marked as minor.
Comment 2 Steven Bosscher 2005-11-13 12:24:30 UTC
*** Bug 24806 has been marked as a duplicate of this bug. ***
Comment 3 Steven Bosscher 2005-11-13 13:56:30 UTC
Created attachment 10230 [details]
patch

I can't think of better wording for the diagnostic.  Some help there would be appreciated.
Comment 4 Uttam Pawar 2005-12-09 21:40:05 UTC
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 <setjmp.h>
 #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:



Comment 5 Paul Thomas 2006-06-05 10:25:37 UTC
Fixed on trunk and 4.1

Paul