From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DA87D3858C39; Thu, 13 Oct 2022 20:29:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DA87D3858C39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665692990; bh=iIgrWtTZLIFokZaATFGV+pJGINR3Ep+zbgNAyMZsS20=; h=From:To:Subject:Date:In-Reply-To:References:From; b=rA46uN07102ZUp0UItf3sNYKSghgnD3vwYTZZ9MaBboKxySpwN3Fj8uiSrJBgdnUp KThK4F9+AnPXt3uZiCpZrTyvafo4Lpg88zJM7XQjWs/+XxHLLtqfKi3dwXW94x9s8u W9mEKVIK772/UjD9ngz1xHjy7lC4b57t1mfbzs9M= From: "anlauf at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/93483] ICE in gfc_constructor_copy, at fortran/constructor.c:103 Date: Thu, 13 Oct 2022 20:29:50 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: anlauf at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: anlauf at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D93483 --- Comment #14 from anlauf at gcc dot gnu.org --- Is it conceivable that a somewhat weaker form of simplification, which addresses the parentheses as well as the basic unary and binary operators could still be used for the time being? There is simplify_intrinsic_op; it just needs to be made non-static. And seems to work here, also for Mikael's example. So on top of the posted patch, diff --git a/gcc/fortran/array.cc b/gcc/fortran/array.cc index 9bec299f160..4e937a4990f 100644 --- a/gcc/fortran/array.cc +++ b/gcc/fortran/array.cc @@ -1207,7 +1207,7 @@ walk_array_constructor (gfc_typespec *ts, gfc_constructor_base head) e =3D c->expr; if (e->expr_type =3D=3D EXPR_OP) - gfc_simplify_expr (e, 0); + simplify_intrinsic_op (e, 0); if (e->expr_type =3D=3D EXPR_ARRAY && e->ts.type =3D=3D BT_UNKNOWN && !e->ref && e->value.constructor) diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 10bb098d136..37dceacbb54 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -3627,6 +3627,7 @@ gfc_expr *gfc_build_conversion (gfc_expr *); void gfc_free_ref_list (gfc_ref *); void gfc_type_convert_binary (gfc_expr *, int); bool gfc_is_constant_expr (gfc_expr *); +bool simplify_intrinsic_op (gfc_expr *, int); bool gfc_simplify_expr (gfc_expr *, int); bool gfc_try_simplify_expr (gfc_expr *, int); int gfc_has_vector_index (gfc_expr *);=