https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113233
--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by LuluCheng <chengl...@gcc.gnu.org>: https://gcc.gnu.org/g:ea2a9c76a1dcffbbec6e53655bef9236d3a8e691 commit r14-7134-gea2a9c76a1dcffbbec6e53655bef9236d3a8e691 Author: Yang Yujie <yangyu...@loongson.cn> Date: Thu Jan 11 09:07:10 2024 +0800 LoongArch: Implement option save/restore LTO option streaming and target attributes both require per-function target configuration, which is achieved via option save/restore. We implement TARGET_OPTION_{SAVE,RESTORE} to switch the la_target context in addition to other automatically maintained option states (via the "Save" option property in the .opt files). Tested on loongarch64-linux-gnu without regression. PR target/113233 gcc/ChangeLog: * config/loongarch/genopts/loongarch.opt.in: Mark options with the "Save" property. * config/loongarch/loongarch.opt: Same. * config/loongarch/loongarch-opts.cc: Refresh -mcmodel= state according to la_target. * config/loongarch/loongarch.cc: Implement TARGET_OPTION_{SAVE, RESTORE} for the la_target structure; Rename option conditions to have the same "la_" prefix. * config/loongarch/loongarch.h: Same.