From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D098E3898527; Thu, 18 Feb 2021 12:42:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D098E3898527 From: "jamborm at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/99122] [10/11 Regression] ICE in force_constant_size, at gimplify.c:733 Date: Thu, 18 Feb 2021 12:42:23 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jamborm at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.3 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2021 12:42:23 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99122 --- Comment #14 from Martin Jambor --- Like with the following, which seems to work as far as inlining is concerne= d, but the latest Jakub's example ICEs when cloning for IPA-CP :-/ (I am also= not sure if the predicate to identify VLAs is the best one). --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -3418,6 +3418,9 @@ force_value_to_type (tree type, tree value) Still if we end up with truly mismatched types here, fall back to using a VIEW_CONVERT_EXPR or a literal zero to not leak invalid GIMPLE to the following passes. */ + if (TREE_CODE (value) =3D=3D WITH_SIZE_EXPR) + value =3D TREE_OPERAND (value, 0); +=20=20 if (!is_gimple_reg_type (TREE_TYPE (value)) || TYPE_SIZE (type) =3D=3D TYPE_SIZE (TREE_TYPE (value))) return fold_build1 (VIEW_CONVERT_EXPR, type, value); @@ -4017,6 +4020,10 @@ inline_forbidden_p (tree fndecl) wi.info =3D (void *) fndecl; wi.pset =3D &visited_nodes; + for (tree parm =3D DECL_ARGUMENTS (fndecl); parm; parm =3D DECL_CHAIN (p= arm)) + if (TREE_CODE (DECL_SIZE (parm)) !=3D INTEGER_CST) + return true; +=20=20 FOR_EACH_BB_FN (bb, fun) {=20 gimple *ret;=