This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/64355] [4.9/5 Regression] ICE (segfault) in gfc_zero_size_array with -fcoarray=single


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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #2 from kargl at gcc dot gnu.org ---
The problem arises in interface.c at 1210.

      if (s1->as->type == AS_EXPLICIT)
    for (i = 0; i < s1->as->rank + s1->as->corank; i++)
      {
        shape1 = gfc_subtract (gfc_copy_expr (s1->as->upper[i]),
                  gfc_copy_expr (s1->as->lower[i]));
        shape2 = gfc_subtract (gfc_copy_expr (s2->as->upper[i]),
                  gfc_copy_expr (s2->as->lower[i]));


(gdb) print *s1->as
$4 = {rank = 0, corank = 1, type = AS_EXPLICIT, cotype = AS_EXPLICIT, 
  lower = {0x20348b240, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, upper = {0x0, 0x0, 
    0x0, 0x0, 0x0, 0x0, 0x0}, cray_pointee = false, cp_was_assumed = false}
(gdb) print *s2->as
$5 = {rank = 0, corank = 1, type = AS_EXPLICIT, cotype = AS_EXPLICIT, 
  lower = {0x20348b540, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, upper = {0x0, 0x0, 
    0x0, 0x0, 0x0, 0x0, 0x0}, cray_pointee = false, cp_was_assumed = false}

Both s1->as->upper[0] and s2->as->upper[0] are NULL.  gfc_copy_expr()
returns NULL, so the code is gfc_subtract(NULL, 0x20348b240).  Well,
gfc_subtract isn't expecting a NULL.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]