From patchwork Mon Mar 31 12:13:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 335282 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 6A6191400AA for ; Mon, 31 Mar 2014 23:13:51 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type; q=dns; s=default; b=mOaijYJkkJd7V/C1 oOBo/UteY6eR7/bBEo6kOd2THXF6n3fxL3ODsKvsiSPRhbon9wCRxDOCDkXjotse 35OOpnOxWJXf0PH0d+vSKg4A25KFTSa5P1AKMCWz0qQHyNc7rIoSDA5QOL5EyHpo AdE3n6JgGOrsJ+4bWZchGOlOTro= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type; s=default; bh=AyfpcbqE4n0MloJ1CFPd2O hVCcM=; b=S4PI+HViC8o9ISnhfNp8St6OS6aSZpnHEFzztHBbLzW35wUjmHKp19 er3HDqrsaBKHcm3miflzbT5XMFhBUYfDx6nVIa7LIVQwq8EklWjfd1RejKhpmm2R Cn2lzl13V+7ckNHDlTrzSD+mp6a4Xd1neHGP8lP1ipjBsDED+VtnE= Received: (qmail 8890 invoked by alias); 31 Mar 2014 12:13:44 -0000 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 Received: (qmail 8868 invoked by uid 89); 31 Mar 2014 12:13:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: smtp-relay.CeBiTec.Uni-Bielefeld.DE Received: from snape.CeBiTec.Uni-Bielefeld.DE (HELO smtp-relay.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 31 Mar 2014 12:13:42 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 42C40FC7; Mon, 31 Mar 2014 14:13:40 +0200 (CEST) Received: from smtp-relay.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Xjd8khd0gX7p; Mon, 31 Mar 2014 14:13:33 +0200 (CEST) Received: from lokon.CeBiTec.Uni-Bielefeld.DE (lokon.CeBiTec.Uni-Bielefeld.DE [129.70.161.110]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id AB1DEFC3; Mon, 31 Mar 2014 14:13:33 +0200 (CEST) Received: (from ro@localhost) by lokon.CeBiTec.Uni-Bielefeld.DE (8.14.7+Sun/8.14.7/Submit) id s2VCDWEh023143; Mon, 31 Mar 2014 14:13:32 +0200 (MEST) From: Rainer Orth To: Jonathan Wakely Cc: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: Re: std::rethrow_exception is broken References: <20140325172551.GD8266@redhat.com> <20140327181024.GB13192@redhat.com> Date: Mon, 31 Mar 2014 14:13:32 +0200 In-Reply-To: <20140327181024.GB13192@redhat.com> (Jonathan Wakely's message of "Thu, 27 Mar 2014 18:10:24 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes Jonathan Wakely writes: > On 25/03/14 17:25 +0000, Jonathan Wakely wrote: >>Tested x86_64-linux, I plan to commit this to trunk soon. >> > >>commit 06a845f80204947afd6866109db58cc85dc87117 >>Author: Jonathan Wakely >>Date: Tue Mar 25 14:42:45 2014 +0000 >> >> PR libstdc++/60612 >> * libsupc++/eh_ptr.cc: Assert __cxa_dependent_exception layout is >> compatible with __cxa_exception. >> * libsupc++/unwind-cxx.h (__cxa_dependent_exception): Add padding. >> Fix typos in comments. >> * testsuite/18_support/exception_ptr/60612-terminate.cc: New. >> * testsuite/18_support/exception_ptr/60612-unexpected.cc: New. > > Committed to trunk. Unfortunately, the new tests FAIL on non-C99 targets (i386-pc-solaris2.9 in my case): FAIL: 18_support/exception_ptr/60612-terminate.cc (test for excess errors) Excess errors: /vol/gcc/src/hg/trunk/local/libstdc++-v3/testsuite/18_support/exception_ptr/6061 2-terminate.cc:26:27: error: '_Exit' was not declared in this scope WARNING: 18_support/exception_ptr/60612-terminate.cc compilation failed to produ ce executable The following patch fixes this, following the idiom often used in the libstdc++ testsuite. Tested with the appropriate runtest invocation on i386-pc-solaris2.{9,11}. Ok for mainline? When looking into this, I noticed that this idiom is very widespread in the v3 testsuite, but IMNSHO a *very bad* idea since it hides the fact that many tests are acutually UNSUPPORTED, but appear to PASS, while the only thing that passes is an empty main. I had something similar recently when all C99 functionality in libstdc++ got disabled, but testsuite results barely changed. Unless someone strongly objects, I expect to change those tests to use corresponding dg-require-* keywords to make mark them appropriately once 4.9 branches. Rainer 2014-03-31 Rainer Orth * testsuite/18_support/exception_ptr/60612-terminate.cc (terminate, f): Wrap in _GLIBCXX_USE_C99. * testsuite/18_support/exception_ptr/60612-unexpected.cc: Likewise. # HG changeset patch # Parent 23f930c5334d34dff20abb2647f50b4a095481e4 Fix 18_support/exception_ptr/60612-*.cc on non-C99 targets diff --git a/libstdc++-v3/testsuite/18_support/exception_ptr/60612-terminate.cc b/libstdc++-v3/testsuite/18_support/exception_ptr/60612-terminate.cc --- a/libstdc++-v3/testsuite/18_support/exception_ptr/60612-terminate.cc +++ b/libstdc++-v3/testsuite/18_support/exception_ptr/60612-terminate.cc @@ -23,6 +23,7 @@ #include #include +#ifdef _GLIBCXX_USE_C99 void terminate() { _Exit(0); } void f() noexcept @@ -34,8 +35,12 @@ void f() noexcept std::rethrow_exception(std::current_exception()); } } +#endif int main() { +#ifdef _GLIBCXX_USE_C99 f(); +#endif + return 0; } diff --git a/libstdc++-v3/testsuite/18_support/exception_ptr/60612-unexpected.cc b/libstdc++-v3/testsuite/18_support/exception_ptr/60612-unexpected.cc --- a/libstdc++-v3/testsuite/18_support/exception_ptr/60612-unexpected.cc +++ b/libstdc++-v3/testsuite/18_support/exception_ptr/60612-unexpected.cc @@ -23,6 +23,7 @@ #include #include +#ifdef _GLIBCXX_USE_C99 void unexpected() { _Exit(0); } void f() throw() @@ -34,8 +35,11 @@ void f() throw() std::rethrow_exception(std::current_exception()); } } +#endif int main() { +#ifdef _GLIBCXX_USE_C99 f(); +#endif }