This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH 0/6] Conversion of gimple types to C++ inheritance (v3)
- From: Jeff Law <law at redhat dot com>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>, Jakub Jelinek <jakub at redhat dot com>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, Bernd Schmidt <bernds at codesourcery dot com>, David Malcolm <dmalcolm at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Andrew MacLeod <amacleod at redhat dot com>
- Date: Wed, 06 Nov 2013 14:04:44 -0700
- Subject: Re: [PATCH 0/6] Conversion of gimple types to C++ inheritance (v3)
- Authentication-results: sourceware.org; auth=none
- References: <5271CBF9 dot 2070005 at redhat dot com> <1383236801-13234-1-git-send-email-dmalcolm at redhat dot com> <527960A8 dot 7030107 at redhat dot com> <CAFiYyc2okBUaSpm61XkeNv04ps4oofRcqu5G0yFmYhAs6FYzqg at mail dot gmail dot com> <527A21DB dot 301 at codesourcery dot com> <CAFiYyc0aX4a_oO_EPogK3V_4Pyp=Et+q7+jb_wgEbt5s8yfxyA at mail dot gmail dot com> <20131106114253 dot GY27813 at tucnak dot zalov dot cz> <Pine dot LNX dot 4 dot 64 dot 1311061316470 dot 9504 at digraph dot polyomino dot org dot uk>
On 11/06/13 06:23, Joseph S. Myers wrote:
Amen! When I've described RTL & trees to other folks in the business
that work(ed) on other compilers, most gasped in horror. Doubly so when
I did this prior to the introduction of the tree/rtl checking systems.
On Wed, 6 Nov 2013, Jakub Jelinek wrote:
On Wed, Nov 06, 2013 at 12:31:00PM +0100, Richard Biener wrote:
Maybe we need to revisit it? As one of those who were not in favour of
the C++ move, can I ask you guys to step back for a moment and think
about - what do all of these changes buy us, exactly? Imagine the state
at the end, where everything is converted and supposedly the temporary
ugliness is gone, what have we gained over the code as it is now?
as_a gains us less runtime checking and more static type checking
which is good.
But that really affects --enable-checking=yes builds (and only cases where
things aren't inlined). If the price for that is uglier and less readable
code, then the price is just too high.
I see static type checking as being about preventing certain sorts of bugs
getting in the compiler at all, rather than about saving time on runtime
checks for --enable-checking=yes.
I hadn't really thought of it that way -- specifically that when we're
done we don't necessarily need to have decls, types, expressions
inheriting from a common tree base class. I must say, I like it as a
I don't have advice on the gimple case. But certainly trees and RTL could
both do with more static typing. There, I'm thinking of different types
of objects (types, expressions, ...) logically being completely separate
static types, not inheriting from a common "tree" base class at all. But
if inheritance and as_a can be used as intermediate steps to allow an
incremental transition to completely separate static types, where
otherwise the whole source tree would need converting at once, that seems
reasonable to me. (I have no comments about what things should look like
in cases where completely separate static types don't make sense but there
is still some sort of inheritance structure.)