From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20669 invoked by alias); 14 Apr 2012 03:48:03 -0000 Received: (qmail 20647 invoked by uid 22791); 14 Apr 2012 03:48:02 -0000 X-SWARE-Spam-Status: No, hits=-3.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-iy0-f175.google.com (HELO mail-iy0-f175.google.com) (209.85.210.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 14 Apr 2012 03:47:50 +0000 Received: by iaag37 with SMTP id g37so5384344iaa.20 for ; Fri, 13 Apr 2012 20:47:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.50.51.226 with SMTP id n2mr311201igo.68.1334375269510; Fri, 13 Apr 2012 20:47:49 -0700 (PDT) Received: by 10.231.150.213 with HTTP; Fri, 13 Apr 2012 20:47:49 -0700 (PDT) In-Reply-To: <20120410084614.GJ6148@sunsite.ms.mff.cuni.cz> References: <4F7B356E.9080003@google.com> <4F7C35A3.3080207@codesourcery.com> <20120410084614.GJ6148@sunsite.ms.mff.cuni.cz> Date: Sat, 14 Apr 2012 03:48:00 -0000 Message-ID: Subject: Re: Switching to C++ by default in 4.8 From: Chiheng Xu To: Jakub Jelinek Cc: Xinliang David Li , Richard Guenther , Bernd Schmidt , Gabriel Dos Reis , David Edelsohn , Diego Novillo , gcc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2012-04/txt/msg00626.txt.bz2 On Tue, Apr 10, 2012 at 4:46 PM, Jakub Jelinek wrote: > >> =C2=A0 =C2=A0*) gcc implementation has lots of hard coded TREE_OPERAND (= exp, nn) >> >> =C2=A0 =C2=A0 =C2=A0e.g. >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 exp->as_component_ref().get_fi= eld() .. >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 exp->as_mem_access().get_base(= ) ... >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 exp->as_mem_acesss().get_addre= ss() --> produces the >> address expression for memory access >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 exp->as_mem_access().get_alias= _handle () >> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 gimple_inst->serialize (&fixup= _list) --> a virtual >> function overriden by actual instruction types that knows its byte >> code format. > > That silently assumes we want to change basic GIMPLE/tree data structures > to virtual classes, which is a significant change that has a significant > cost as well. =C2=A0E.g. all such changed data structures grow by a virtu= al > pointer field. =C2=A0Those data structures are heavily optimized for memo= ry > footprint. > Not to mention it is very questionable if the above stuff is more readable > than what we currently have. > And I want to say that tree/gimple/rtl are compiler's data(or state), not compiler's text(or logic), the most important thing about them is how to access their fields. --=20 Chiheng Xu