[Bug fortran/68227] ICE on using variable limit in forall header (gfc_do_allocate)
kargl at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Nov 21 17:42:00 GMT 2015
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.
More information about the Gcc-bugs
mailing list