[PR fortran/88248, patch] - [F18] Bogus warning about obsolescent feature: Labeled DO statement

Harald Anlauf anlauf@gmx.de
Wed Feb 13 22:50:00 GMT 2019


Sorry, forgot to attach the patch to the revised testcase f2018_obs.f90.
Here it is.

Regards,
Harald

Adjusted ChangeLog:

2019-02-13  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/88248
	* gfortran.dg/pr88248.f90: New test.
	* gfortran.dg/f2018_obs.f90: Updated test.

On 02/13/19 23:38, Harald Anlauf wrote:
> The attached patch moves the check for labeled DO statements to
> the place where a label is referenced instead of where a label
> was defined, which lead to false positives.
> 
> Regtested on x86_64-pc-linux-gnu.
> 
> OK for trunk?
> 
> Thanks,
> Harald
> 
> 2019-02-13  Harald Anlauf  <anlauf@gmx.de>
> 
> 	PR fortran/88248
> 	* symbol.c: Move check for labeled DO statement from
> 	gfc_define_st_label to gfc_reference_st_label.
> 
> 2019-02-13  Harald Anlauf  <anlauf@gmx.de>
> 
> 	PR fortran/88248
> 	* gfortran.dg/pr88248.f90: New test.
> 

-------------- next part --------------
Index: gcc/testsuite/gfortran.dg/f2018_obs.f90
===================================================================
--- gcc/testsuite/gfortran.dg/f2018_obs.f90	(revision 268826)
+++ gcc/testsuite/gfortran.dg/f2018_obs.f90	(working copy)
@@ -19,8 +19,8 @@
 
   equivalence (a(10),b(1))           ! { dg-warning "obsolescent feature" }
 
-  do 99 i=1,10
-99 continue                          ! { dg-warning "obsolescent feature" }
+  do 99 i=1,10                       ! { dg-warning "obsolescent feature" }
+99 continue
 
   j = (/ 0, 1, 2, 3, 4, 0, 6, 7  /)
   forall (i=1:8, j(i) /= 0)          ! { dg-warning "obsolescent feature" }


More information about the Gcc-patches mailing list