[patch, Fortran] Fix PR 71902

Thomas Koenig tkoenig@netcologne.de
Thu Aug 18 19:24:00 GMT 2016


Hello Mikael,

> This doesn't look correct, what about substrings following component or
> array references?

You're right; corrected in the attached patch.  I have also added a test
case for this.

> PS: What about the original fix, wasn't it a dependency
> problem/inaccuracy after all?

The main error was using the allocatable attribute on the symbol that
we were dealing with a deferred length.  Changing the test to check for
expr->ts.deferred is the right thing to do.

There are still some some overly pessimistic assumptions in dependency
handling.  However, I am not sure that this causes actual performance
issues.

Regards

	Thomas

2016-08-18  Thomas Koenig  <tkoenig@gcc.gnu.org>

         PR fortran/71902
         * frontend-passes.c (realloc_string_callback):  Check for deferred
         on the expression instead for allocatable on the symbol.  Name 
temporary
         variable "realloc_string".

2016-08-18  Thomas Koenig  <tkoenig@gcc.gnu.org>

         PR fortran/71902
         * gfortran.dg/dependency_47.f90:  New test.
         * gfortran.dg/dependency_48.f90:  New test.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: p6.diff
Type: text/x-patch
Size: 1356 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20160818/7500bbd4/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dependency_48.f90
Type: text/x-fortran
Size: 379 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20160818/7500bbd4/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dependency_47.f90
Type: text/x-fortran
Size: 405 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20160818/7500bbd4/attachment-0002.bin>


More information about the Fortran mailing list