From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2775 invoked by alias); 28 Oct 2011 00:01:56 -0000 Received: (qmail 2758 invoked by uid 22791); 28 Oct 2011 00:01:55 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from acsinet15.oracle.com (HELO acsinet15.oracle.com) (141.146.126.227) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 28 Oct 2011 00:01:37 +0000 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by acsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id p9S01ZaJ029698 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 28 Oct 2011 00:01:36 GMT Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id p9S01Ybg003991 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 28 Oct 2011 00:01:34 GMT Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id p9S01TWL013623; Thu, 27 Oct 2011 19:01:29 -0500 Received: from [192.168.1.4] (/79.52.193.167) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 27 Oct 2011 17:01:28 -0700 Message-ID: <4EA9F0D3.4040800@oracle.com> Date: Fri, 28 Oct 2011 01:44:00 -0000 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: Paolo Carlini CC: Jason Merrill , "gcc-patches@gcc.gnu.org" Subject: Re: [C++ Patch / RFC] PR 50870 References: <4EA81BB4.8090900@oracle.com> <4EA826EA.4040900@redhat.com> <4EA82C27.3020700@oracle.com> <4EA8350D.8060907@redhat.com> <4EA8879F.40906@oracle.com> <4EA88E3A.4010808@redhat.com> <4EA88F7B.3060706@oracle.com> <4EA89101.6050001@oracle.com> <4EA8D9D8.3050307@redhat.com> <4EA940B1.9050905@oracle.com> <4EA951F2.70001@redhat.com> <11793E27-1CB6-4DD4-8CE4-3E093859A870@oracle.com> <4EA956C7.6070700@redhat.com> <2DB482BE-B822-4FEF-80CC-2BF05FF4B9DB@oracle.com> <4EA9E469.2070701@oracle.com> In-Reply-To: <4EA9E469.2070701@oracle.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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-10/txt/msg02589.txt.bz2 .. thus now I'm investigating, comparing 4.5 to mainline, where the former gets the TYPE_BINFO of the TREE_OPERAND (member, 0). And the answer is "simple": at the beginning of tsubst_copy_and_build case COMPONENT_REF itself! Where: member = TREE_OPERAND (t, 1); if (BASELINK_P (member)) member = tsubst_baselink (member, non_reference (TREE_TYPE (object)), args, complain, in_decl); else member = tsubst_copy (member, args, complain, in_decl); the tsubst_copy call changes very little member in mainline. From this: full-name "struct impl" no-binfo use_template=1 interface-unknown chain > arg 1 local bindings <(nil)>> arg 1 >>> to this: full-name "struct impl" no-binfo use_template=1 interface-unknown chain > arg 1 VOID align 1 symtab 0 alias set -1 canonical type 0x7ffff5765888 pointer_to_this reference_to_this > arg 0 local bindings <(nil)>> arg 1 >>> note: no changes for arg0, no-binfo. Instead, in the 4.5 case, from: " no-binfo use_template=1 interface-unknown chain > arg 1 local bindings <(nil)>> arg 1 >>> To: unit size align 8 symtab 0 alias set -1 canonical type 0x7ffff5a15690 fields external nonlocal suppress-debug decl_4 VOID file 50870.C line 6 col 3 align 8 context result > full-name "struct impl" X() X(constX&) this=(X&) n_parents=0 use_template=1 interface-unknown pointer_to_this chain > arg 1 VOID align 1 symtab 0 alias set -1 canonical type 0x7ffff59f8bd0 pointer_to_this reference_to_this > arg 0 local bindings <(nil)>> arg 1 >>> arg0 gets its fields. Now, a big difference between the two - 4.5 vs mainline - tsubst_copy calls, is the args argument. In 4.5, a very simple and understandable: elt 1 elt 2 > in mainline: > elt 1 > elt 2 > elt 3 >> args comes directly from the tsubst_copy_and_build arguments, looks like we reach case COMPONENT_REF with the template arguments still unsubstituted, something is simply not done earlier in mainline. I guess I had better stopping here in terms of details on the mailing list today. If you have some further hints... Thanks! Paolo.