[Bug fortran/89751] [PDT] ICE: Segmentation fault (in resolve_component)
janus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Mar 19 16:50:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89751
janus at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
See Also| |https://gcc.gnu.org/bugzill
| |a/show_bug.cgi?id=89707
--- Comment #3 from janus at gcc dot gnu.org ---
(In reply to Dominique d'Humieres from comment #1)
> The test compiles with the following patch
>
> --- ../_clean/gcc/fortran/resolve.c 2019-03-18 09:41:55.000000000 +0100
> +++ gcc/fortran/resolve.c 2019-03-18 11:37:56.000000000 +0100
> @@ -13973,7 +13976,7 @@ resolve_component (gfc_component *c, gfc
> }
>
> /* Procedure pointer components: Check PASS arg. */
> - if (c->attr.proc_pointer && !c->tb->nopass && c->tb->pass_arg_num == 0
> + if (c->attr.proc_pointer && c->tb && !c->tb->nopass &&
> c->tb->pass_arg_num == 0
> && !sym->attr.vtype)
> {
> gfc_symbol* me_arg;
I don't think this is a particularly good idea. One should rather make sure
that the tb component is present, e.g. via:
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 749faf9fabe..86beb2c6f2f 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -3737,6 +3737,7 @@ gfc_get_pdt_instance (gfc_actual_arglist *param_list,
gfc_symbol **sym,
c2->ts = c1->ts;
c2->attr = c1->attr;
+ c2->tb = c1->tb;
/* The order of declaration of the type_specs might not be the
same as that of the components. */
However this runs into a different ICE :(
> However I have no idea if the test is valid or not.
I would say it is valid (at least I don't see why it wouldn't be).
This is very much related to PR 89707, almost a duplicate.
More information about the Gcc-bugs
mailing list