[Bug fortran/43178] Pointless resetting to NULL for local ALLOCATABLEs

burnus at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Fri Feb 26 16:37:00 GMT 2010



------- Comment #6 from burnus at gcc dot gnu dot org  2010-02-26 16:37 -------
(In reply to comment #4)
> The first obvious wrong code is for gcc/testsuite/gfortran.dg/streamio_6.f90:
> but without the patch a[100] is not intialized
> >   static integer(kind=4) a[100];

In trans-decl.c:

  if (TREE_STATIC (decl) && !sym->attr.use_assoc
      && (sym->attr.save || sym->attr.is_main_program))
    {

Change attr.is_main_program to sym->ns->proc_name->attr.is_main_program

That happens with late morning changes, when one wants to urgently leave for
work ...

Without the change you will get tons of errors for variables initialized in
PROGRAM - something particularly common in the test suite.

As I wrote this morning: "I have not regtested it, but I think it is very
unlikely that it fails" :-)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43178



More information about the Gcc-bugs mailing list