https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121627

kargls at comcast dot net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargls at comcast dot net

--- Comment #1 from kargls at comcast dot net ---
This leads to the same ICE without the overhead of a Fortran IO statement.

program real_kinds
  use iso_fortran_env
  i = real64
end program real_kinds

The ICE occurs due to line the strcmp below.


  tmp_symtree = gfc_find_symtree (gfc_current_ns->sym_root, name);
  if (tmp_symtree != NULL)
    {
      if (strcmp (modname, tmp_symtree->n.sym->module) == 0)
        return;
      else
        gfc_error ("Symbol %qs already declared", name);
    }


$5 = {name = 0x204a14490 "real_kinds", module = 0x0, declared_at = {
    nextc = 0x2040d2308, u = {lb = 0x2040d22a0, location = 8657904288}}, ts = {
    type = BT_UNKNOWN, kind = 0, u = {derived = 0x0, cl = 0x0, pad = 0}, 

(gdb) p modname
$6 = 0x335a800 <use_iso_fortran_env_module()::mod> "iso_fortran_env"

We have a NULL pointer dereference tmp_symtree->n.sym->module == NULL.

Reply via email to