This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/68227] ICE on using variable limit in forall header (gfc_do_allocate)
- 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: Sat, 21 Nov 2015 17:42:49 +0000
- Subject: [Bug fortran/68227] ICE on using variable limit in forall header (gfc_do_allocate)
- Auto-submitted: auto-generated
- References: <bug-68227-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68227
kargl at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kargl at gcc dot gnu.org
Assignee|unassigned at gcc dot gnu.org |kargl at gcc dot gnu.org
--- Comment #4 from kargl at gcc dot gnu.org ---
This patch
% svn diff trans-stmt.c
Index: trans-stmt.c
===================================================================
--- trans-stmt.c (revision 230709)
+++ trans-stmt.c (working copy)
@@ -3130,9 +3130,8 @@ gfc_do_allocate (tree bytesize, tree siz
type = build_range_type (gfc_array_index_type, gfc_index_zero_node, tmp);
type = build_array_type (elem_type, type);
- if (gfc_can_put_var_on_stack (bytesize))
+ if (gfc_can_put_var_on_stack (bytesize) && INTEGER_CST_P (size))
{
- gcc_assert (INTEGER_CST_P (size));
tmpvar = gfc_create_var (type, "temp");
*pdata = NULL_TREE;
}
removes the ICE and it passes regression testing. The original
code was committed in r87187 over 11 years ago. It would seem
that the assert can be relaxed to a conditional expression in
the if-statement.