------- Comment #3 from burnus at gcc dot gnu dot org  2007-08-22 17:46 -------
> The error is caused by this line of subroutine get_cand:
>   integer  :: i,j,k,ndim=size(cl)
> if it is replaced by
>   integer  :: i,j,k,ndim
>   ndim=size(cl)
> then the error doesn't occur.

Note: The first version implies SAVE, i.e. ndim is set only once to "size(cl)"
and remains unchanged when you call the procedure the next time. This can be
used for, e.g.,

logical, SAVE :: first_run = .true.
if (first_run) print *, "First Run"
first_run = .false.

In order that this works one needs to have an initialization expression. In the
second case, SAVE is not implied and you have a normal variable.

Note: This is different from C where both versions are doing the same. The SAVE
equivalent in C is "static".

As it works using the right syntax and it is properly diagnosed with gfortran
4.3, I close it as WONTFIX. If you really believe it should be fixed in 4.2,
please reopen.

PS: Thanks for the bug report.


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
      Known to fail|                            |4.2.1 4.1.3
      Known to work|                            |4.3.0
         Resolution|                            |WONTFIX
            Summary|internal compiler error: in |[4.1 and 4.2 only] internal
                   |gfc_conv_constant           |compiler error: in
                   |                            |gfc_conv_constant


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

Reply via email to