From 887e182f05d64c0cb2a888711d8d6ca1174fe93a Mon Sep 17 00:00:00 2001 From: Monk Chiang Date: Mon, 15 Apr 2019 08:19:23 +0000 Subject: [NDS32] Refine force unwind. Linux kernel only uses RT_SIGRETURN. libgcc/ * config/nds32/linux-unwind.h (SIGRETURN): Remove. (RT_SIGRETURN): Update. (nds32_fallback_frame_state): Update. From-SVN: r270363 --- libgcc/ChangeLog | 6 ++++++ libgcc/config/nds32/linux-unwind.h | 9 +++------ 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 950eeab..de8d56a 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,9 @@ +2019-04-15 Monk Chiang + + * config/nds32/linux-unwind.h (SIGRETURN): Remove. + (RT_SIGRETURN): Update. + (nds32_fallback_frame_state): Update. + 2019-02-21 Martin Sebor * libgcc2.h (__clear_cache): Correct signature. diff --git a/libgcc/config/nds32/linux-unwind.h b/libgcc/config/nds32/linux-unwind.h index 0c4df4dd..adb6f9f 100644 --- a/libgcc/config/nds32/linux-unwind.h +++ b/libgcc/config/nds32/linux-unwind.h @@ -42,8 +42,7 @@ struct _rt_sigframe { struct ucontext_t uc; }; -#define SIGRETURN 0xeb0e0a64 -#define RT_SIGRETURN 0xab150a64 +#define RT_SIGRETURN 0x8b00f044 #define MD_FALLBACK_FRAME_STATE_FOR nds32_fallback_frame_state @@ -74,16 +73,14 @@ nds32_fallback_frame_state (struct _Unwind_Context *context, /* Check if we are going through a signal handler. See arch/nds32/kernel/signal.c implementation. - SWI_SYS_SIGRETURN -> (0xeb0e0a64) - SWI_SYS_RT_SIGRETURN -> (0xab150a64) FIXME: Currently we only handle little endian (EL) case. */ - if (pc[0] == SIGRETURN || pc[0] == RT_SIGRETURN) + if (pc[0] == RT_SIGRETURN) { /* Using '_sigfame' memory address to locate kernal's sigcontext. The sigcontext structures in arch/nds32/include/asm/sigcontext.h. */ struct _rt_sigframe *rt_; rt_ = context->cfa; - sc_ = &rt_->sig.uc.uc_mcontext; + sc_ = &rt_->uc.uc_mcontext; } else return _URC_END_OF_STACK; -- cgit v1.1 From 48528842bd79cb2e2a1d478b1d90d748377bb76c Mon Sep 17 00:00:00 2001 From: Ramana Radhakrishnan Date: Tue, 23 Apr 2019 10:03:41 +0000 Subject: re PR target/89093 (C++ exception handling clobbers d8 VFP register) PR target/89093 * config/arm/arm.c (aapcs_vfp_is_call_or_return_candidate): Diagnose if used with general-regs-only. (arm_conditional_register_usage): Don't add non-general regs if general-regs-only. (arm_valid_target_attribute_rec): Handle general-regs-only. * config/arm/arm.h (TARGET_HARD_FLOAT): Return false if general-regs-only. (TARGET_HARD_FLOAT_SUB): Define. (TARGET_SOFT_FLOAT): Define as negation of TARGET_HARD_FLOAT_SUB. (TARGET_REALLY_IWMMXT): Add && !TARGET_GENERAL_REGS_ONLY. (TARGET_REALLY_IWMMXT2): Likewise. * config/arm/arm.opt: Add -mgeneral-regs-only. * doc/extend.texi: Document ARM general-regs-only target. * doc/invoke.texi: Document ARM -mgeneral-regs-only. libgcc/ * config/arm/pr-support.c: Add #pragma GCC target("general-regs-only"). * config/arm/unwind-arm.c: Likewise. * unwind-c.c (PERSONALITY_FUNCTION): Add general-regs-only target attribute for ARM. libobjc/ * exception.c (PERSONALITY_FUNCTION): Add general-regs-only target attribute for ARM. libphobos/ * libdruntime/gcc/deh.d: Import gcc.attribute. (personality_fn_attributes): New enum. (scanLSDA, CONTINUE_UNWINDING, gdc_personality, __gdc_personality): Add @personality_fn_attributes. libstdc++-v3/ * libsupc++/eh_personality.cc (PERSONALITY_FUNCTION): Add general-regs-only target attribute for ARM. Co-Authored-By: Bernd Edlinger Co-Authored-By: Jakub Jelinek From-SVN: r270504 --- libgcc/ChangeLog | 10 ++++++++++ libgcc/config/arm/pr-support.c | 1 + libgcc/config/arm/unwind-arm.c | 1 + libgcc/unwind-c.c | 1 + 4 files changed, 13 insertions(+) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index de8d56a..30e4da4 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,13 @@ +2019-04-23 Ramana Radhakrishnan + Bernd Edlinger + Jakub Jelinek + + PR target/89093 + * config/arm/pr-support.c: Add #pragma GCC target("general-regs-only"). + * config/arm/unwind-arm.c: Likewise. + * unwind-c.c (PERSONALITY_FUNCTION): Add general-regs-only target + attribute for ARM. + 2019-04-15 Monk Chiang * config/nds32/linux-unwind.h (SIGRETURN): Remove. diff --git a/libgcc/config/arm/pr-support.c b/libgcc/config/arm/pr-support.c index ed55739..bcf9b28 100644 --- a/libgcc/config/arm/pr-support.c +++ b/libgcc/config/arm/pr-support.c @@ -21,6 +21,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ +#pragma GCC target ("general-regs-only") #include "unwind.h" /* We add a prototype for abort here to avoid creating a dependency on diff --git a/libgcc/config/arm/unwind-arm.c b/libgcc/config/arm/unwind-arm.c index 00e183d3..9ba73e7 100644 --- a/libgcc/config/arm/unwind-arm.c +++ b/libgcc/config/arm/unwind-arm.c @@ -21,6 +21,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ +#pragma GCC target ("general-regs-only") #include "unwind.h" /* Misc constants. */ diff --git a/libgcc/unwind-c.c b/libgcc/unwind-c.c index 3e55cda..859735a 100644 --- a/libgcc/unwind-c.c +++ b/libgcc/unwind-c.c @@ -106,6 +106,7 @@ PERSONALITY_FUNCTION (_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *); _Unwind_Reason_Code +__attribute__((target ("general-regs-only"))) PERSONALITY_FUNCTION (_Unwind_State state, struct _Unwind_Exception * ue_header, struct _Unwind_Context * context) -- cgit v1.1