From patchwork Tue Aug 2 15:32:49 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 107948 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 4526EB7105 for ; Wed, 3 Aug 2011 01:33:15 +1000 (EST) Received: (qmail 10418 invoked by alias); 2 Aug 2011 15:33:10 -0000 Received: (qmail 10410 invoked by uid 22791); 2 Aug 2011 15:33:09 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, SPF_HELO_PASS, TW_CX X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 02 Aug 2011 15:32:51 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p72FWpqu005921 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 2 Aug 2011 11:32:51 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p72FWpKC010025 for ; Tue, 2 Aug 2011 11:32:51 -0400 Received: from [0.0.0.0] ([10.3.113.4]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p72FWou0022350 for ; Tue, 2 Aug 2011 11:32:50 -0400 Message-ID: <4E3818A1.7070906@redhat.com> Date: Tue, 02 Aug 2011 11:32:49 -0400 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20110719 Thunderbird/5.0 MIME-Version: 1.0 To: gcc-patches List Subject: Re: C++ PATCH for c++/49260 (lambda-eh2.C failure on several targets) References: <4E020F44.50205@redhat.com> In-Reply-To: <4E020F44.50205@redhat.com> Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On 06/22/2011 11:50 AM, Jason Merrill wrote: > This failure was happening on all targets that don't use either CFI > assembler directives or asynchronous unwind tables: we were mistakenly > deciding that the _FUN thunk for returning from the lambda function > pointer conversion operator couldn't throw because build_call_a wasn't > setting cp_function_chain->can_throw. There seems to be no reason to set > that flag in build_cxx_call rather than build_call_a, so I've moved it. Looking at this again before applying it to 4.6.2, I'm not sure that it's safe to drop the at_function_scope_p() check, so I'm going to put it back in to be safe. Tested x86_64-pc-linux-gnu, applying to trunk and 4.6.2. commit 631465c6d70a602d274e760af7912ad384f67750 Author: Jason Merrill Date: Tue Aug 2 09:06:05 2011 -0400 * call.c (build_call_a): Also check at_function_scope_p. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 2eab782..b0133e2 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -352,7 +352,7 @@ build_call_a (tree function, int n, tree *argarray) nothrow = ((decl && TREE_NOTHROW (decl)) || TYPE_NOTHROW_P (TREE_TYPE (TREE_TYPE (function)))); - if (!nothrow && cfun && cp_function_chain) + if (!nothrow && at_function_scope_p () && cfun && cp_function_chain) cp_function_chain->can_throw = 1; if (decl && TREE_THIS_VOLATILE (decl) && cfun && cp_function_chain)