public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/114848] loongarch: epilogue in _Unwind_RaiseException corrupts return value due to __builtin_eh_return Date: Tue, 30 Apr 2024 01:09:51 +0000 [thread overview] Message-ID: <bug-114848-4-cRpXnPS27i@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-114848-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114848 --- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-12 branch has been updated by LuluCheng <chenglulu@gcc.gnu.org>: https://gcc.gnu.org/g:bb78099d2624b52c781ed6e5d85e43d54c3cda1a commit r12-10403-gbb78099d2624b52c781ed6e5d85e43d54c3cda1a Author: Yang Yujie <yangyujie@loongson.cn> Date: Fri Dec 8 18:01:18 2023 +0800 LoongArch: Fix eh_return epilogue for normal returns. On LoongArch, the regitsters $r4 - $r7 (EH_RETURN_DATA_REGNO) will be saved and restored in the function prologue and epilogue if the given function calls __builtin_eh_return. This causes the return value to be overwritten on normal return paths and breaks a rare case of libgcc's _Unwind_RaiseException. gcc/ChangeLog: PR target/114848 * config/loongarch/loongarch.cc: Do not restore the saved eh_return data registers ($r4-$r7) for a normal return of a function that calls __builtin_eh_return elsewhere. * config/loongarch/loongarch-protos.h: Same. * config/loongarch/loongarch.md: Same. gcc/testsuite/ChangeLog: * gcc.target/loongarch/eh_return-normal-return.c: New test. (cherry picked from commit 4b421728289e6f1caa0dfaa953a11698ab95d37d)
next prev parent reply other threads:[~2024-04-30 1:09 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-04-25 7:45 [Bug target/114848] New: longarch: " pinskia at gcc dot gnu.org 2024-04-25 8:00 ` [Bug target/114848] " xry111 at gcc dot gnu.org 2024-04-25 8:04 ` pinskia at gcc dot gnu.org 2024-04-25 8:11 ` [Bug target/114848] loongarch: " xry111 at gcc dot gnu.org 2024-04-25 8:21 ` pinskia at gcc dot gnu.org 2024-04-27 9:05 ` chenglulu at loongson dot cn 2024-04-30 1:09 ` cvs-commit at gcc dot gnu.org [this message] 2024-04-30 1:11 ` cvs-commit at gcc dot gnu.org 2024-04-30 1:20 ` xry111 at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-114848-4-cRpXnPS27i@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).