Proposed patch to 13249

Paul Brook paul@codesourcery.com
Sat May 22 14:51:00 GMT 2004


On Tuesday 18 May 2004 07:37, Victor Leikehman wrote:
> Paul Brook wrote:
> > However the proposed patch is just glossing over deeper problems.
>
> I suspected something like this, really :-)  Still, the existing
> code hacks around these problems in cases like the following:
>
>   PROGRAM MAIN
>   INTEGER FOO
>   COMMON /FOO/ BAR
>   END
>
> I just can't explain to myself why it is possible to work around
> this example, but not the one with module usage.

I don't like it, but I've applied you suggested chang as a temporary fix.

> For full appreciation of the problem, I am missing an example of
> invalid code that is rejected now, but will be accepted if we
> remove the call to check_used as proposed.  If nothing else,
> we can use that example as a part of the test suite, especially
> for regression testing when a real fix to the problem will appear.

Without a proper fix we can't diagnose the following as illegal:

implicit none
save foo
common /foo/ bar

Paul

2004-05-22  Victor Leikehman  <lei@haifasphere.co.il>

	PR fortran/13249
	* symbol.c (gfc_add_common): Disable checks to work around other more
	fundamental inadequacies.

Index: symbol.c
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/gcc/fortran/symbol.c,v
retrieving revision 1.3
diff -u -p -r1.3 symbol.c
--- a/symbol.c	14 May 2004 13:00:04 -0000	1.3
+++ b/symbol.c	22 May 2004 14:38:43 -0000
@@ -722,9 +722,13 @@ gfc_add_dummy (symbol_attribute * attr, 
 try
 gfc_add_common (symbol_attribute * attr, locus * where)
 {
-
+  /* TODO: We currently add common blocks into the same namespace as normal
+     variables.  This is wrong.  Disable the checks below as a temporary
+     hack.  See PR13249  */
+#if 0
   if (check_used (attr, where) || check_done (attr, where))
     return FAILURE;
+#endif
 
   attr->common = 1;
   return check_conflict (attr, where);



More information about the Fortran mailing list