This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, Fortran, OOP] PR 58185: [4.8/4.9 Regression] ICE when selector in SELECT TYPE is non-polymorphic
- From: Mikael Morin <mikael dot morin at sfr dot fr>
- To: Janus Weil <janus at gcc dot gnu dot org>
- Cc: gfortran <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 21 Aug 2013 23:09:32 +0200
- Subject: Re: [Patch, Fortran, OOP] PR 58185: [4.8/4.9 Regression] ICE when selector in SELECT TYPE is non-polymorphic
- References: <CAKwh3qhRvbWNM9ErqW49pKZH-MxKV8JiM-3vz1bdCiRgbz1vcQ at mail dot gmail dot com>
Le 19/08/2013 13:38, Janus Weil a écrit :
> Hi all,
>
> here is a small patch which does some cleanup to avoid an ICE on
> invalid SELECT TYPE statements.
>
> The first three hunks are just cosmetics, and the fourth one also
> contains minor refactoring, where I pull some common code out of the
> two branches of an if statement. The important part, however, is that
> I prevent gfc_build_class_symbol from being called if no type symbol
> is available.
>
> Regtested on x86_64-unknown-linux-gnu. Ok for trunk and 4.8?
>
> + else if (selector->ts.u.derived)
Hum, accessing ts.u.derived is correct only if selector->ts.type is
BT_DERIVED or BT_CLASS, isn't it? Thus the condition should probably be
else if (selector->ts.type == BT_DERIVED) as the BT_CLASS was handled
before? OK with that change (if it works). Thanks.
Mikael