From patchwork Tue Sep 21 23:48:42 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 65388 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 9F2B6B70F1 for ; Wed, 22 Sep 2010 09:48:53 +1000 (EST) Received: (qmail 19784 invoked by alias); 21 Sep 2010 23:48:51 -0000 Received: (qmail 19776 invoked by uid 22791); 21 Sep 2010 23:48:51 -0000 X-SWARE-Spam-Status: No, hits=-6.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD 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, 21 Sep 2010 23:48:45 +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.13.8/8.13.8) with ESMTP id o8LNmhI5029126 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 21 Sep 2010 19:48:44 -0400 Received: from [127.0.0.1] (ovpn-113-40.phx2.redhat.com [10.3.113.40]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o8LNmhve017197 for ; Tue, 21 Sep 2010 19:48:43 -0400 Message-ID: <4C99445A.1040800@redhat.com> Date: Tue, 21 Sep 2010 19:48:42 -0400 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.12) Gecko/20100917 Lightning/1.0b1 Shredder/3.0.9pre MIME-Version: 1.0 To: gcc-patches List Subject: C++ PATCH to fix crash building libstdc++ with -fabi-version=1 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 I tried building libstdc++ with -fabi-version=1 -Wabi to see what warnings it would produce, and it crashed on atomic.cc trying to mangle a SCOPE_REF where op 1 is an IDENTIFIER_NODE rather than the DECL that the code expected. Tested x86_64-pc-linux-gnu, applied to trunk. commit 5ee539810a1c405172eaaff79dfdec8cf98bb282 Author: Jason Merrill Date: Tue Sep 21 16:59:12 2010 -0400 * mangle.c (write_expression) [SCOPE_REF]: Only do -fabi-version=1 special handling if we know the member. diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index 03e2837..39001c5 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -2491,7 +2491,7 @@ write_expression (tree expr) tree scope = TREE_OPERAND (expr, 0); tree member = TREE_OPERAND (expr, 1); - if (!abi_version_at_least (2)) + if (!abi_version_at_least (2) && DECL_P (member)) { write_string ("sr"); write_type (scope);