[PATCH] fortran: Detect duplicate unlimited polymorphic types [PR103662]

Mikael Morin morin-mikael@orange.fr
Thu Apr 21 21:14:47 GMT 2022


Hello,

this is a fix for PR103662, a TBAA issue with unlimited polymorphic types.

I attached a draft patch to the PR which was accumulating all unlimited
polymorphic symbols to a single namespace, avoiding duplicate symbols
and thus eliminating the problem.

After reviewing the code more in detail, I was afraid that some symbols
could still end up in the local namespace, and that the problem would
remain for them after all.

Despite not being able to generate a testcase where it happened, I
decided to produce a patch based on Jakub’s analysis in the PR audit
trail, as that way supports duplicates by design.

On top of Jakub’s patch, there are a couple more types registrations
just in case (they handle duplicates so that’s fine), and the type
comparison fix that he was too fortran-uncomfortable to do.

The testcase had to be fixed as we found out in the PR audit trail.

Regression tested on x86_64-pc-linux-gnu. OK for master?

Mikael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-fortran-Detect-duplicate-unlimited-polymorphic-types.patch
Type: text/x-patch
Size: 8109 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/fortran/attachments/20220421/6e9bad98/attachment-0001.bin>


More information about the Fortran mailing list