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

airplanemath <airplanemath at aol dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |7.3.0

--- Comment #3 from airplanemath <airplanemath at aol dot com> ---
The line it's stuck on seems to be:
#0  0x00000001004fcf20 in build_common_decl (is_init=false,
union_type=<optimized out>, com=0x60013e1f0) at
/usr/src/debug/gcc-7.4.0-1/gcc/fortran/trans-common.c:463
463           attributes = gfc_add_attributes_to_decl (com->head->attr,
NULL_TREE);

Printing the value of "com->head" gives 0x0, which would cause the segfault.

Two frames up seems to be the last time com->head gets touched, in
"gfc_get_common_head", which is a macro expanding to "XCNEW (gfc_common_head)",
which is a macro expanding to "((gfc_common_head *) xcalloc (1, sizeof
(gfc_common_head)))".  xcalloc just allocates and zeros memory, so that's not
it.

The Mingw-w64 compiler does not hit this problem because it returns on line
423. There's enough optimization to make it tricky to narrow down farther.

Going back to the Cygwin compiler, I hit the error and check the conditions for
the exit used by the Mingw-w64 compiler:
---
(gdb) print is_init
$2 = false
(gdb) print decl
$3 = (tree) 0x6fffff00ab0
---
Since the condition is ((decl != NULL_TREE) && (!is_init || ...)), I think the
exit should have been taken here as well.

This suggests that the issue is not with the equivalence-in-module code.  I
downloaded the old 7.3.0 binaries and checked again, to find the problem does
not occur in that version.  I then installed the 7.4.0 binaries and found the
error still in place.  I will check for more help on the cygwin list.

Reply via email to