gfortran 4.3.0 regressions

Tobias Burnus burnus@net-b.de
Thu Jan 24 20:25:00 GMT 2008


Hi all,

first, please make sure all PRs which are for regressions are marked such.

secondly, it is now the right time to re-check that all the programs 
that used to work still do so.

thirdly, I really would like to see the following regressions fixed in 
GCC 4.3.0 (release):


PR 34946
ICE in gfc_trans_create_temp_array, at fortran/trans-array.c:592
Breaks Joost's CP2K


PR 34848
ICE with optional character arguments
Breaks CASTEP
(A fix probably also fixes PR 34868.)
I have a patch (see PR), which breaks other things. I do not think I 
will time before the weekend ... thus if you want to pitch in ...


PR 32760
Rejects valid
I think no real-world program depends on this, but it would be great 
nonetheless.


The other regressions seem to be less important or only regressions 
versus g77; if the patch is small I do not object fixing them, but we 
really should first fix the three bugs above.


As the latter PR mostly requires clever thinking and not looking at the 
code, I post the problem below.

Assume:

module m
  public :: print, write, volatile, istat
contains
   subroutine one
       allocatable :: d(:)
       volatile :: b
       volatile c
       print *, b
       write(99,*) c
       allocate(d(4),stat=istat)
   end subroutine one
   subroutine print(); end subroutine
   subroutine write(); end subroutine
   subroutine volatile(); end subroutine
end module m


"public :: " creates the symbols with the flavor "FL_UNKNOWN". The task 
is now to ensure that in ALLOCATE "istat" is FL_VARIABLE but volatile, 
write and print remain FL_UNKNOWN.

Currently, "PRINT" and "VOLATILE" are wrongly marked as FL_VARIABLE.

The current algorithm is (primary.c, match_variable):

    case FL_UNKNOWN:
      {
        sym_flavor flavor = FL_UNKNOWN;

        gfc_gobble_whitespace ();

        if (sym->attr.external || sym->attr.procedure
            || sym->attr.function || sym->attr.subroutine)
          flavor = FL_PROCEDURE;
        else if (gfc_peek_char () != '(' || sym->ts.type != BT_UNKNOWN
                 || sym->attr.pointer || sym->as != NULL)
          flavor = FL_VARIABLE;

        if (flavor != FL_UNKNOWN
            && gfc_add_flavor (&sym->attr, flavor, sym->name, NULL) == 
FAILURE)
          return MATCH_ERROR;
      }

Now, please start to think!


Tobias



More information about the Fortran mailing list