From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 125334 invoked by alias); 23 Apr 2015 22:06:53 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 125208 invoked by uid 89); 23 Apr 2015 22:06:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 23 Apr 2015 22:06:51 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t3NM6l8I024649 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 23 Apr 2015 18:06:47 -0400 Received: from localhost.localdomain (ovpn-113-113.phx2.redhat.com [10.3.113.113]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t3NM6kvt005908; Thu, 23 Apr 2015 18:06:46 -0400 Message-ID: <55396CF6.8020707@redhat.com> Date: Thu, 23 Apr 2015 22:06:00 -0000 From: Jeff Law User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Jan Kratochvil , gcc@gcc.gnu.org CC: Phil Muldoon , Tom Tromey , gdb@sourceware.org Subject: Re: [gcc libcc1] build_qualified_type for self-referencing/incomplete types References: <20150410123145.GA18073@host1.jankratochvil.net> <20150414060905.GA22747@host1.jankratochvil.net> <20150417152213.GA2589@host1.jankratochvil.net> <20150418101953.GA12295@host1.jankratochvil.net> In-Reply-To: <20150418101953.GA12295@host1.jankratochvil.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2015-04/txt/msg00049.txt.bz2 On 04/18/2015 04:19 AM, Jan Kratochvil wrote: > On Fri, 17 Apr 2015 17:22:13 +0200, Jan Kratochvil wrote: >> How to get 'volatile struct sv' GCC 'tree' type for: >> volatile struct sv { volatile struct sv *p; }; > > I have found out how it can work, even with no change on the GCC side: > > Instead of current: > plugin_build_record_type: > record_type = make_node (RECORD_TYPE) > plugin_build_add_field: > add fields to record_type... But there is no qualified_record_type here! > plugin_finish_record_or_union: > TYPE_SIZE (record_type) etc. ... to finish the type > plugin_build_qualified_type: > qualified_record_type = build_qualified_type (record_type, ...) > one can do instead: > plugin_build_record_type: > record_type = make_node (RECORD_TYPE) > plugin_build_qualified_type: > qualified_record_type = build_qualified_type (record_type, ...) > plugin_build_add_field: > add fields to qualified_record_type > plugin_finish_record_or_union: > TYPE_SIZE (qualified_record_type) etc. ... to finish the type > And one forgets about the unfinished record_type. > > For a different cv-quals of the same record type one builds a new cv-qualified > record from scratch. I'm a bit surprised the former didn't work, but if the latter is working consistently, then I'd stick with it. jeff