From patchwork Tue Jan 24 00:34:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Marlier X-Patchwork-Id: 137501 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 C49E4B6FC4 for ; Tue, 24 Jan 2012 11:35:16 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1327970118; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC: Subject:Content-Type:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=pbOK/GoUpYuVayWimliJOX3e0ls=; b=cecW4MwoiJ8s2M8 1IHIlw3/PzWMlx/iRxwhkjp75LJadLhihKwpVZ6rTpyeHLFOdRUkYf7jY9sSctBK OyZHuTXLbnxFS3J35HFS52deM1mRc5Cv80o3y0BE4jLZhEqzOTh7GlW1h+0EGfkq km20akKGuR8kE2sZdKFCnbd4Ttlk= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=XZ5yDlP0o6wKM9FJemm5dbd/h/Cr/R6Ueat0+BmIZBIhB2ENqdmD/XEolDNDoH Vb3e3ryaa4vi6DeE2h5v6x3f+5uqlmEPDE+0pUcNk4Y5qYmvQLop8/pTNwEfuGms F0zm+tJZu6bdQbiwN/BtdLBxPlXocrzH6vRpEauGZUCKM=; Received: (qmail 7742 invoked by alias); 24 Jan 2012 00:35:13 -0000 Received: (qmail 7585 invoked by uid 22791); 24 Jan 2012 00:35:12 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, TW_FN X-Spam-Check-By: sourceware.org Received: from mail-qy0-f175.google.com (HELO mail-qy0-f175.google.com) (209.85.216.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 24 Jan 2012 00:34:59 +0000 Received: by qcsp14 with SMTP id p14so1802638qcs.20 for ; Mon, 23 Jan 2012 16:34:58 -0800 (PST) Received: by 10.229.136.200 with SMTP id s8mr3708445qct.9.1327365298710; Mon, 23 Jan 2012 16:34:58 -0800 (PST) Received: from [192.168.2.2] (cpe-69-207-95-157.rochester.res.rr.com. [69.207.95.157]) by mx.google.com with ESMTPS id g17sm29831865qad.3.2012.01.23.16.34.57 (version=SSLv3 cipher=OTHER); Mon, 23 Jan 2012 16:34:57 -0800 (PST) Message-ID: <4F1DFCB0.7050701@gmail.com> Date: Mon, 23 Jan 2012 19:34:56 -0500 From: Patrick Marlier User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111124 Thunderbird/8.0 MIME-Version: 1.0 To: gcc-patches CC: Richard Henderson , Aldy Hernandez , Torvald Riegel , Jason Merrill , mark@codesourcery.com, nathan@codesourcery.com Subject: [trans-mem,c++] PR51928 X-IsSubscribed: yes 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 Hi, In this PR51928, it tries to look_for_tm_attr_overrides on a thunk but there is no DECL_NAME for thunk. So it fails in lookup_fnfields_idx_nolazy because name is NULL. #0 0x0000000000764b5a in lookup_fnfields_idx_nolazy (type=0x7ffff69f77e0, name=0x0) at ../../trunk/gcc/cp/search.c:1384 #1 0x000000000076551a in lookup_fnfields_1 (type=0x7ffff69f77e0, name=0x0) at ../../trunk/gcc/cp/search.c:1470 #2 0x000000000076886e in look_for_overrides_here (type=0x7ffff69f77e0, fndecl=0x7ffff69f8800) at ../../trunk/gcc/cp/search.c:2026 #3 0x0000000000635a94 in look_for_tm_attr_overrides (type=0x7ffff6a091f8, fndecl=0x7ffff69f8800) at ../../trunk/gcc/cp/class.c:4337 I hope the good way to solve this is to use the THUNK_TARGET instead of the thunk itself. (or just ignore when it is a thunk?) Tested on x86_64-unknown-linux-gnu. Thanks. --- Patrick Marlier. Changelog 2012-01-23 Patrick Marlier PR c++/51928 * cp/class.c (set_method_tm_attributes): Use TARGET_THUNK instead of thunk for set_one_vmethod_tm_attributes. testsuite/Changelog 2012-01-23 Patrick Marlier PR c++/51928 * g++.dg/tm/pr51928.C: New test. Index: cp/class.c =================================================================== --- cp/class.c (revision 183448) +++ cp/class.c (working copy) @@ -4430,7 +4430,12 @@ set_method_tm_attributes (tree t) tree vchain; for (vchain = BINFO_VIRTUALS (TYPE_BINFO (t)); vchain; vchain = TREE_CHAIN (vchain)) - set_one_vmethod_tm_attributes (t, BV_FN (vchain)); + { + fndecl = BV_FN (vchain); + if (DECL_THUNK_P (fndecl)) + fndecl = THUNK_TARGET (fndecl); + set_one_vmethod_tm_attributes (t, fndecl); + } } /* If the class doesn't have an attribute, nothing more to do. */