This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/64355] [4.9/5 Regression] ICE (segfault) in gfc_zero_size_array with -fcoarray=single
- From: "kargl at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 18 Dec 2014 21:13:45 +0000
- Subject: [Bug fortran/64355] [4.9/5 Regression] ICE (segfault) in gfc_zero_size_array with -fcoarray=single
- Auto-submitted: auto-generated
- References: <bug-64355-4 at http dot gcc dot gnu dot org/bugzilla/>
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.