From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 05B5A3858C78; Tue, 5 Mar 2024 11:58:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 05B5A3858C78 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709639889; bh=mx/MLp9A3dDB5NiS/+hpxp/wL8Gun5LADNS3GKIUdFE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=tE+HpX+tqI/XC2h6cd6yo14X0egHKU+dfyvSCkKSUZnk1yppz7aDpW2mxQ+Q4DMJH FF1HxuniAtD8UTSOHRwIUm+Bmw5gP3o36litNp3p0LzV1Ogl7yvp0w+9IOMZXLxI5x D1JdjRofMKpufHPxQ222AWWSi2RXYUq+9pDxq3rs= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/114232] [14 regression] ICE when building rr-5.7.0 with LTO on x86 Date: Tue, 05 Mar 2024 11:58:08 +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: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ubizjak at gmail dot com X-Bugzilla-Target-Milestone: 14.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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114232 --- Comment #15 from Jakub Jelinek --- Yeah, indeed, the optabs enable flags are cached in the optimization node, = so it is ok to check the optimization flags in there, or target flags as well, but optimize_function_for_*_p is not, because it depends also on node->count/node->frequency of the current function but multiple functions = can have the same optimization node/target node combo. Seems i386 is the only backend which does something like that. I believe this has been fixed in the backend in the past already, see e.g. PR92791 While if (opts !=3D optimization_default_node) { init_tree_optimization_optabs (opts); if (TREE_OPTIMIZATION_OPTABS (opts)) this_fn_optabs =3D (struct target_optabs *) TREE_OPTIMIZATION_OPTABS (opts); } in invoke_set_current_function_hook maybe (hopefully) makes stuff work right for the different options, that certainly doesn't account for node->function/node->count. Seems various backends use e.g. optimize_size or !optimize_size or optimize= > 0 etc. in insn-flags.h, so perhaps change optimize_function_for_size_p (cfun) to optimize_size?=