From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BC8A1385E448; Tue, 9 Apr 2024 09:03:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BC8A1385E448 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712653423; bh=Pe/vkaWh4hUPGBQRBGKJeiCxCwP05z1RY7gPAOkjSK0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=O5wj3gT0vIDtYNGxAlGN8GwiztgGoSJhhbUy1B6vCGViBb70+cSw/qAmpSOX6LRbX 5kRJrFjW4RgAruSmJXRZ7oi1B7/LRGGpjHTcQ+gwPkVQ5dkJGRiIZInkwJdPRW5gqW zDBGxSINCVnMXYxXG1bKTvR10Pv9S279qNyOyYr8= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/113233] LoongArch: target options from LTO objects not respected during linking Date: Tue, 09 Apr 2024 09:03:41 +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: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: REOPENED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned 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=3D113233 --- Comment #12 from GCC Commits --- The master branch has been updated by LuluCheng : https://gcc.gnu.org/g:8657d76d583f0f87000e9003ba75922f2bbe4455 commit r14-9866-g8657d76d583f0f87000e9003ba75922f2bbe4455 Author: Yang Yujie Date: Mon Apr 8 16:45:13 2024 +0800 LoongArch: Enable switchable target This patch fixes the back-end context switching in cases where functions should be built with their own target contexts instead of the global one, such as LTO linking and functions with target attributes (T= BD). PR target/113233 gcc/ChangeLog: * config/loongarch/loongarch.cc (loongarch_reg_init): Reinitialize the loongarch_regno_mode_ok cache. (loongarch_option_override): Same. (loongarch_save_restore_target_globals): Restore target globals. (loongarch_set_current_function): Restore the target contexts for functions. (TARGET_SET_CURRENT_FUNCTION): Define. * config/loongarch/loongarch.h (SWITCHABLE_TARGET): Enable switchable target context. * config/loongarch/loongarch-builtins.cc (loongarch_init_builti= ns): Initialize all builtin functions at startup. (loongarch_expand_builtin): Turn assertion of builtin availabil= ity into a test. gcc/testsuite/ChangeLog: * lib/target-supports.exp: Define condition loongarch_sx_as. * gcc.dg/lto/pr113233_0.c: New test.=