[Bug fortran/92701] ICE assigning to assumed rank derived type component

2021-10-24 Thread dominiq at lps dot ens.fr via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92701

--- Comment #3 from Dominique d'Humieres  ---
This seems to have been fixed between r11-4933 and r11-6947 and back ported to
gcc10.

[Bug fortran/92701] ICE assigning to assumed rank derived type component

2021-10-24 Thread sandra at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92701

sandra at gcc dot gnu.org changed:

   What|Removed |Added

 CC||sandra at gcc dot gnu.org

--- Comment #2 from sandra at gcc dot gnu.org ---
The testcase no longer ICEs on mainline head.  Just mark this issue fixed, or
would it be useful to identify what fixed it?

[Bug fortran/92701] ICE assigning to assumed rank derived type component

2019-11-27 Thread burnus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92701

Tobias Burnus  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2019-11-27
 CC||burnus at gcc dot gnu.org,
   ||pault at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Tobias Burnus  ---
No regression as 'select rank' is new.

In gfc_check_vardef_context, assoc->variable == NULL and
assoc->target == NULL  [this one causes the segfault] and
assoc->st->name == "__tmp_class___class_a_R_15_0t_rank_1"

On the other hand, e->symtree->n.sym->assoc->target exists and
e->symtree->n.sym->assoc->target->symtree == assoc->st.

assoc gets set (ll. 6213–6219) as:
  gfc_expr* t = sym->assoc->target;
  gcc_assert (t->expr_type == EXPR_VARIABLE);
  name = t->symtree->name;
  if (t->symtree->n.sym->assoc)
assoc = t->symtree->n.sym->assoc;
  else
assoc = sym->assoc;
That's sufficient for:
  gcc_assert (name && assoc);
But then it fails when doing:
  assoc->target->expr_type
(That's for !assoc->variable – but also the else branch assumes that
assoc->target != NULL.)