From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25441 invoked by alias); 30 Aug 2011 14:02:19 -0000 Received: (qmail 25431 invoked by uid 22791); 30 Aug 2011 14:02:17 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 30 Aug 2011 14:01:54 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 118AC2BB1ED; Tue, 30 Aug 2011 10:01:54 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id lrC1BofnWxIb; Tue, 30 Aug 2011 10:01:54 -0400 (EDT) Received: from kwai.gnat.com (kwai.gnat.com [205.232.38.4]) by rock.gnat.com (Postfix) with ESMTP id F3C8E2BB1EA; Tue, 30 Aug 2011 10:01:53 -0400 (EDT) Received: by kwai.gnat.com (Postfix, from userid 4192) id E4CBA3FEE8; Tue, 30 Aug 2011 10:01:53 -0400 (EDT) Date: Tue, 30 Aug 2011 15:05:00 -0000 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Tristan Gingold Subject: [Ada] Do not catch exception if _UA_FORCE_UNWIND flag is set. Message-ID: <20110830140153.GA26313@adacore.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="SLDf9lqlvOQaIe6s" Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-08/txt/msg02460.txt.bz2 --SLDf9lqlvOQaIe6s Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 271 Fix a non-compliance with the unwind ABI. No pure Ada testcase. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-08-30 Tristan Gingold * raise-gcc.c: Never catch exception if _UA_FORCE_UNWIND flag is set, to be compliant with the ABI. --SLDf9lqlvOQaIe6s Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=difs Content-length: 2395 Index: raise-gcc.c =================================================================== --- raise-gcc.c (revision 178293) +++ raise-gcc.c (working copy) @@ -217,7 +217,7 @@ static void db_phases (int phases) { - phase_descriptor *a = phase_descriptors; + const phase_descriptor *a = phase_descriptors; if (! (db_accepted_codes() & DB_PHASES)) return; @@ -901,6 +901,7 @@ static void get_action_description_for (_Unwind_Context *uw_context, _Unwind_Exception *uw_exception, + _Unwind_Action uw_phase, region_descriptor *region, action_descriptor *action) { @@ -965,17 +966,22 @@ /* Positive filters are for regular handlers. */ else if (ar_filter > 0) { - /* See if the filter we have is for an exception which matches - the one we are propagating. */ - _Unwind_Ptr choice = get_ttype_entry_for (region, ar_filter); + /* Do not catch an exception if the _UA_FORCE_UNWIND flag is + passed (to follow the ABI). */ + if (!(uw_phase & _UA_FORCE_UNWIND)) + { + /* See if the filter we have is for an exception which + matches the one we are propagating. */ + _Unwind_Ptr choice = get_ttype_entry_for (region, ar_filter); - if (is_handled_by (choice, gnat_exception)) - { - action->kind = handler; - action->ttype_filter = ar_filter; - action->ttype_entry = choice; - return; - } + if (is_handled_by (choice, gnat_exception)) + { + action->kind = handler; + action->ttype_filter = ar_filter; + action->ttype_entry = choice; + return; + } + } } /* Negative filter values are for C++ exception specifications. @@ -1128,7 +1134,8 @@ /* Search the call-site and action-record tables for the action associated with this IP. */ - get_action_description_for (uw_context, uw_exception, ®ion, &action); + get_action_description_for (uw_context, uw_exception, uw_phases, + ®ion, &action); db_action_for (&action, uw_context); /* Whatever the phase, if there is nothing relevant in this frame, --SLDf9lqlvOQaIe6s--