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/66193] ICE for initialisation of some non-zero-sized arrays


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

--- Comment #8 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
This patch looks good:

--- arith.c     (Revision 223202)
+++ arith.c     (Arbeitskopie)
@@ -1390,6 +1390,12 @@ reduce_binary (arith (*eval) (gfc_expr *, gfc_expr
   if (op1->expr_type == EXPR_CONSTANT && op2->expr_type == EXPR_CONSTANT)
     return eval (op1, op2, result);

+  if (op1->expr_type == EXPR_ARRAY)
+    gfc_check_constructor_type (op1);
+
+  if (op2->expr_type == EXPR_ARRAY)
+    gfc_check_constructor_type (op2);
+
   if (op1->expr_type == EXPR_CONSTANT && op2->expr_type == EXPR_ARRAY)
     return reduce_binary_ca (eval, op1, op2, result);


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