diff options
author | Janus Weil <janus@gcc.gnu.org> | 2016-11-12 10:25:47 +0100 |
---|---|---|
committer | Janus Weil <janus@gcc.gnu.org> | 2016-11-12 10:25:47 +0100 |
commit | b93d8a3f16bc7582254edf988b14009587fe00a6 (patch) | |
tree | a92471f741422298fc072b9fce90e59618cc8d65 /gcc/fortran/decl.c | |
parent | 330cc73d9838aa51c162f29ed1e5ccf659b440d3 (diff) | |
download | gcc-b93d8a3f16bc7582254edf988b14009587fe00a6.zip gcc-b93d8a3f16bc7582254edf988b14009587fe00a6.tar.gz gcc-b93d8a3f16bc7582254edf988b14009587fe00a6.tar.bz2 |
re PR fortran/77501 ([F03] ICE in gfc_match_generic, at fortran/decl.c:9429)
2016-11-12 Janus Weil <janus@gcc.gnu.org>
PR fortran/77501
* class.c (gfc_find_typebound_intrinsic_op): Remove an unnecessary
assert and nullification.
* decl.c (gfc_match_decl_type_spec): Use gfc_get_tbp_symtree,
fix indentation.
(gfc_match_generic): Remove an unnecessary assert.
Use gfc_get_tbp_symtree to avoid ICE.
2016-11-12 Janus Weil <janus@gcc.gnu.org>
PR fortran/77501
* gfortran.dg/typebound_generic_16.f90: New test.
From-SVN: r242335
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r-- | gcc/fortran/decl.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index bf6bc24..b17a8aa 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -3198,13 +3198,11 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag) upe->attr.zero_comp = 1; if (!gfc_add_flavor (&upe->attr, FL_DERIVED, NULL, &gfc_current_locus)) - return MATCH_ERROR; - } + return MATCH_ERROR; + } else { - st = gfc_find_symtree (gfc_current_ns->sym_root, "STAR"); - if (st == NULL) - st = gfc_new_symtree (&gfc_current_ns->sym_root, "STAR"); + st = gfc_get_tbp_symtree (&gfc_current_ns->sym_root, "STAR"); st->n.sym = upe; upe->refs++; } @@ -9731,14 +9729,7 @@ gfc_match_generic (void) gfc_symtree* st; st = gfc_find_symtree (is_op ? ns->tb_uop_root : ns->tb_sym_root, name); - if (st) - { - tb = st->n.tb; - gcc_assert (tb); - } - else - tb = NULL; - + tb = st ? st->n.tb : NULL; break; } @@ -9783,10 +9774,8 @@ gfc_match_generic (void) case INTERFACE_USER_OP: { const bool is_op = (op_type == INTERFACE_USER_OP); - gfc_symtree* st; - - st = gfc_new_symtree (is_op ? &ns->tb_uop_root : &ns->tb_sym_root, - name); + gfc_symtree* st = gfc_get_tbp_symtree (is_op ? &ns->tb_uop_root : + &ns->tb_sym_root, name); gcc_assert (st); st->n.tb = tb; |