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/48097] gcc sometimes generates code that uses the buggy libgcc_s unwinder on darwin (originally exposed by Throw_2 failures in libjava testsuite under Xcode 4.0) Date: Mon, 01 Mar 2021 19:37:21 +0000 [thread overview] Message-ID: <bug-48097-4-m2VIlU4LX5@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-48097-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48097 --- Comment #18 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Iain D Sandoe <iains@gcc.gnu.org>: https://gcc.gnu.org/g:491d5b3cf8216f9285a67aa213b9a66b0035137b commit r11-7443-g491d5b3cf8216f9285a67aa213b9a66b0035137b Author: Iain Sandoe <iain@sandoe.co.uk> Date: Mon Jan 18 20:09:10 2021 +0000 dwarf2unwind : Force the CFA after remember/restore pairs [44107/48097]. This address one of the more long-standing and serious regressions for Darwin. GCC emits unwind code by default on the assumption that the unwinder will be (of have the same capability) as the one in the current libgcc_s. For Darwin platforms, this is not the case - some of them are based on the libgcc_s from GCC-4.2.1 and some are using the unwinder provided by libunwind (part of the LLVM project). The latter implementation has gradually adopted a section that deals with GNU unwind. The most serious problem for some of the platform versions is in handling DW_CFA_remember/restore_state pairs. The DWARF description talks about these in terms of saving/restoring register rows; this is what GCC originally did (and is what the unwinders do for the Darwin versions based on libgcc_s). However, in r118068, this was changed so that not only the registers but also the current frame address expression were saved. The unwind code assumes that the unwinder will do this; some of Darwin's unwinders do not, leading to lockups etc. To date, the only solution has been to replace the system libgcc_s with a newer one which is not a viable solution for many end-users (since that means overwritting the one provided with the system installation). The fix here provides a target hook that allows the target to specify that the CFA should be reinstated after a DW_CFA_restore. This fixes the issue (and also the closed WONTFIX of 44107). (As a matter of record, it also fixes reported Java issues if backported to GCC-5). gcc/ChangeLog: PR target/44107 PR target/48097 * config/darwin-protos.h (darwin_should_restore_cfa_state): New. * config/darwin.c (darwin_should_restore_cfa_state): New. * config/darwin.h (TARGET_ASM_SHOULD_RESTORE_CFA_STATE): New. * doc/tm.texi: Regenerated. * doc/tm.texi.in: Document TARGET_ASM_SHOULD_RESTORE_CFA_STATE. * dwarf2cfi.c (connect_traces): If the target requests, restore the CFA expression after a DW_CFA_restore. * target.def (TARGET_ASM_SHOULD_RESTORE_CFA_STATE): New hook.
next prev parent reply other threads:[~2021-03-01 19:37 UTC|newest] Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-03-12 21:28 [Bug target/48097] New: new Throw_2 failures in libjava under Xcode 4.0 howarth at nitro dot med.uc.edu 2011-03-12 21:35 ` [Bug target/48097] " howarth at nitro dot med.uc.edu 2011-03-12 21:37 ` howarth at nitro dot med.uc.edu 2011-03-17 20:18 ` howarth at nitro dot med.uc.edu 2011-03-18 0:45 ` howarth at nitro dot med.uc.edu 2011-03-18 8:18 ` jakub at gcc dot gnu.org 2011-03-18 8:35 ` iains at gcc dot gnu.org 2011-03-18 8:55 ` jakub at gcc dot gnu.org 2011-03-18 17:48 ` howarth at nitro dot med.uc.edu 2012-02-26 8:15 ` howarth at nitro dot med.uc.edu 2013-09-14 15:47 ` iains at gcc dot gnu.org 2013-09-16 14:38 ` howarth at nitro dot med.uc.edu 2021-02-28 15:35 ` [Bug target/48097] gcc sometimes generates code that uses the buggy libgcc_s unwinder on darwin (originally exposed by Throw_2 failures in libjava testsuite under Xcode 4.0) egallager at gcc dot gnu.org 2021-03-01 19:37 ` cvs-commit at gcc dot gnu.org [this message] 2021-03-21 23:52 ` cvs-commit at gcc dot gnu.org 2021-05-01 13:08 ` cvs-commit at gcc dot gnu.org 2021-08-27 14:38 ` iains 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-48097-4-m2VIlU4LX5@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).