From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BF6C03858C56; Tue, 12 Apr 2022 11:03:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BF6C03858C56 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/105234] [12 Regression] inlining failed in call to 'always_inline' 'memset': target specific option mismatch since r12-5920-g01ad8c54fdca1d Date: Tue, 12 Apr 2022 11:03:27 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: marxin at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.0 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: Tue, 12 Apr 2022 11:03:27 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105234 --- Comment #10 from Jakub Jelinek --- 2022-04-12 Jakub Jelinek PR target/105234 * attribs.cc (decl_attributes): Don't set DECL_FUNCTION_SPECIFIC_TARGET if target_option_default_node is NULL. --- gcc/attribs.cc.jj 2022-02-04 14:36:53.947620076 +0100 +++ gcc/attribs.cc 2022-04-12 12:52:36.630967329 +0200 @@ -636,15 +636,20 @@ decl_attributes (tree *node, tree attrib && !DECL_FUNCTION_SPECIFIC_OPTIMIZATION (*node)) { DECL_FUNCTION_SPECIFIC_OPTIMIZATION (*node) =3D optimization_current= _node; - tree cur_tree - =3D build_target_option_node (&global_options, &global_options_set); - tree old_tree =3D DECL_FUNCTION_SPECIFIC_TARGET (*node); - if (!old_tree) - old_tree =3D target_option_default_node; - /* The changes on optimization options can cause the changes in - target options, update it accordingly if it's changed. */ - if (old_tree !=3D cur_tree) - DECL_FUNCTION_SPECIFIC_TARGET (*node) =3D cur_tree; + /* Don't set DECL_FUNCTION_SPECIFIC_TARGET for targets that don't + support #pragma GCC target or target attribute. */ + if (target_option_default_node) + { + tree cur_tree + =3D build_target_option_node (&global_options, &global_options_= set); + tree old_tree =3D DECL_FUNCTION_SPECIFIC_TARGET (*node); + if (!old_tree) + old_tree =3D target_option_default_node; + /* The changes on optimization options can cause the changes in + target options, update it accordingly if it's changed. */ + if (old_tree !=3D cur_tree) + DECL_FUNCTION_SPECIFIC_TARGET (*node) =3D cur_tree; + } } /* If this is a function and the user used #pragma GCC target, add the certainly works for me.=