diff mbox

[ARM,ping1] Fix PR target/56846

Message ID 000501d00a2a$f4e532b0$deaf9810$@arm.com
State New
Headers show

Commit Message

Thomas Preud'homme Nov. 27, 2014, 10:14 a.m. UTC
> -----Original Message-----
> From: Richard Biener [mailto:rguenther@suse.de]
> Sent: Thursday, November 27, 2014 9:57 AM
> To: Ramana Radhakrishnan
> Cc: Thomas Preud'homme; 'Jonathan Wakely'; Jakub Jelinek; Tony Wang;
> gcc-patches@gcc.gnu.org; dan@debian.org; aph-
> gcc@littlepinkcloud.com; Richard Earnshaw; libstdc++@gcc.gnu.org
> Subject: Re: [Patch, ARM, ping1] Fix PR target/56846
> 
> On Thu, 27 Nov 2014, Ramana Radhakrishnan wrote:
> 
> >
> >
> > On 27/11/14 09:34, Richard Biener wrote:
> > > On Thu, 27 Nov 2014, Thomas Preud'homme wrote:
> > >
> > > > Thanks. Ccing release manager for their opinion.
> > >
> > > It doesn't look ARM specific and frankly I have not too much
> expertise
> > > in this area.  The patch has been on trunk for more than two months
> > > though so I guess it is ok to backport.
> > >
> >
> > It is ARM specific because the whole thing sits in a #ifdef
> > __ARM_EABI_UNWINDER__ in eh_personality.cc.
> 
> Ah, too little patch context then.

Sorry, my bad. Below is the patch that were sent by Tony at that time with 20 lines of context:

Best regards,

Thomas
diff mbox

Patch

diff --git a/libstdc++-v3/libsupc++/eh_personality.cc b/libstdc++-v3/libsupc++/eh_personality.cc
index f315a83..cb4467a 100644
--- a/libstdc++-v3/libsupc++/eh_personality.cc
+++ b/libstdc++-v3/libsupc++/eh_personality.cc
@@ -361,40 +361,46 @@  PERSONALITY_FUNCTION (int version,
     found_cleanup,
     found_handler
   } found_type;
 
   lsda_header_info info;
   const unsigned char *language_specific_data;
   const unsigned char *action_record;
   const unsigned char *p;
   _Unwind_Ptr landing_pad, ip;
   int handler_switch_value;
   void* thrown_ptr = 0;
   bool foreign_exception;
   int ip_before_insn = 0;
 
 #ifdef __ARM_EABI_UNWINDER__
   _Unwind_Action actions;
 
   switch (state & _US_ACTION_MASK)
     {
     case _US_VIRTUAL_UNWIND_FRAME:
+      // If the unwind state pattern is
+      // _US_VIRTUAL_UNWIND_FRAME | _US_FORCE_UNWIND
+      // then we don't need to search for any handler as it is not a real
+      // exception. Just unwind the stack.
+      if (state & _US_FORCE_UNWIND)
+	CONTINUE_UNWINDING;
       actions = _UA_SEARCH_PHASE;
       break;
 
     case _US_UNWIND_FRAME_STARTING:
       actions = _UA_CLEANUP_PHASE;
       if (!(state & _US_FORCE_UNWIND)
 	  && ue_header->barrier_cache.sp == _Unwind_GetGR(context,
 							  UNWIND_STACK_REG))
 	actions |= _UA_HANDLER_FRAME;
       break;
 
     case _US_UNWIND_FRAME_RESUME:
       CONTINUE_UNWINDING;
       break;
 
     default:
       std::abort();
     }
   actions |= state & _US_FORCE_UNWIND;