[Patch] Fortran: add contiguous check for ptr assignment, fix non-contig check (PR97242)

Tobias Burnus tobias@codesourcery.com
Wed Sep 30 08:58:46 GMT 2020


The non-contiguous had both check false positive and false
negative results. Some more refinements
are surely possible, but hopefully there are no longer
false positives.

I also now used this check for pointer assignments where the
LHS pointer has the contiguous attribute.

In the non-contiguous-check function:
- for 'dt(i)%array' it returned true due to dt(i) but that's
   an element, which is contiguous.
- ref_size (which is a size) is compared with 'arr_size' calculated
   via dep_difference,, which returns upper-lower but array size is
   (upper-lower)+1.
- fixed a memory leak.

OK?

Tobias

-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fort-contig.diff
Type: text/x-patch
Size: 6384 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20200930/478edafd/attachment.bin>


More information about the Gcc-patches mailing list