From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 015E1385042B; Thu, 3 Sep 2020 19:26:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 015E1385042B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1599161188; bh=sbu0vdlCDj5RfO1IBINOejoQIc1l9/wg0dNXXbNTXl8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=YElZv1Em7ATbKD1V+PFh311lnVS10f11jwWGF2OnLhzP7yf0Jta+6lpaOyJ4o3Foj snOGUbhqOnfQLfx2aWmXQM9w2o/cFQBKBSU/IO4YMeGNb+NZqbh6huko0vBM6TfkxE IYE6uVhLTxRoV6SkizwrnsYqwqKqaVX3CtXSYUlo= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/96905] [10/11 Regression] ICE with consteval function: internal compiler error: in cp_gimplify_expr, at cp/cp-gimplify.c:827 Date: Thu, 03 Sep 2020 19:26:27 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned 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, 03 Sep 2020 19:26:28 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96905 --- Comment #5 from Jakub Jelinek --- Tried --- gcc/cp/semantics.c.jj 2020-09-01 09:17:50.000000000 +0200 +++ gcc/cp/semantics.c 2020-09-03 21:20:20.678830381 +0200 @@ -4517,7 +4517,7 @@ expand_or_defer_fn_1 (tree fn) return false; } - if (DECL_OMP_DECLARE_REDUCTION_P (fn)) + if (DECL_IMMEDIATE_FUNCTION_P (fn) || DECL_OMP_DECLARE_REDUCTION_P (fn)) return false; return true; --- gcc/cp/decl2.c.jj 2020-07-28 15:39:09.780759362 +0200 +++ gcc/cp/decl2.c 2020-09-03 21:23:15.973278453 +0200 @@ -2172,7 +2172,7 @@ void mark_needed (tree decl) { TREE_USED (decl) =3D 1; - if (TREE_CODE (decl) =3D=3D FUNCTION_DECL) + if (TREE_CODE (decl) =3D=3D FUNCTION_DECL && !DECL_IMMEDIATE_FUNCTION_P = (decl)) { /* Extern inline functions don't become needed when referenced. If we know a method will be emitted in other TU and no new --- gcc/cp/pt.c.jj 2020-09-01 09:17:28.042110726 +0200 +++ gcc/cp/pt.c 2020-09-03 21:14:14.497159429 +0200 @@ -23891,8 +23891,10 @@ mark_decl_instantiated (tree result, int { mark_definable (result); mark_needed (result); + if (DECL_IMMEDIATE_FUNCTION_P (result)) + ; /* Always make artificials weak. */ - if (DECL_ARTIFICIAL (result) && flag_weak) + else if (DECL_ARTIFICIAL (result) && flag_weak) comdat_linkage (result); /* For WIN32 we also want to put explicit instantiations in linkonce sections. */ but that is still not enough, the above are just some hacks to avoid creati= ng cgraph nodes for immediate functions, but e.g. c_parse_final_cleanups still creates them.=