From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14119 invoked by alias); 18 Apr 2015 10:20:05 -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 14024 invoked by uid 89); 18 Apr 2015 10:20:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.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; Sat, 18 Apr 2015 10:20:03 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t3IAJxsI013064 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Sat, 18 Apr 2015 06:19:59 -0400 Received: from host1.jankratochvil.net (ovpn-116-27.ams2.redhat.com [10.36.116.27]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t3IAJrbx030329 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 18 Apr 2015 06:19:57 -0400 Date: Sat, 18 Apr 2015 10:20:00 -0000 From: Jan Kratochvil To: gcc@gcc.gnu.org Cc: Phil Muldoon , Tom Tromey , gdb@sourceware.org Subject: Re: [gcc libcc1] build_qualified_type for self-referencing/incomplete types Message-ID: <20150418101953.GA12295@host1.jankratochvil.net> References: <20150410123145.GA18073@host1.jankratochvil.net> <20150414060905.GA22747@host1.jankratochvil.net> <20150417152213.GA2589@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150417152213.GA2589@host1.jankratochvil.net> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2015-04/txt/msg00040.txt.bz2 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. Jan