This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Great example of why "everything is a tree" sucks
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: gcc at gcc dot gnu dot org, Richard Biener <richard dot guenther at gmail dot com>, Steven Bosscher <stevenb dot gcc at gmail dot com>, Diego Novillo <dnovillo at google dot com>, Jakub Jelinek <jakub at redhat dot com>, Jeff Law <law at redhat dot com>
- Date: Wed, 13 Nov 2013 18:22:50 +0100
- Subject: Re: Great example of why "everything is a tree" sucks
- Authentication-results: sourceware.org; auth=none
- References: <528288B3 dot 8010109 at redhat dot com> <1608460 dot i0thhgDpq4 at polaris> <Pine dot LNX dot 4 dot 64 dot 1311131314190 dot 18987 at digraph dot polyomino dot org dot uk>
> Other places where GENERIC provides something that no doubt seemed
> convenient originally, but is less useful when you want to ensure things
> are evaluated at exactly the time implied by language semantics, include
> SAVE_EXPRs and pre/post increment/decrement.
I'm a little skeptical here because Ada is second to no other languages (at
least those supported by GCC) when it comes to precise rules of evaluation of
expressions or elaboration of types; of course GENERIC knows nothing about of
them and, precisely because of that, it's possible to support a significant
range of semantics with it, including that of Ada.
> I'd be happy for front ends to move to doing all these things themselves,
> rather than trying to define GENERIC in a way that works for every
> language's requirements on when things are evaluated and when storage is
> allocated / deallocated.
I'm under the impression that the view is skewed here because the C family of
compilers essentially build their ASTs in GENERIC, so they give it properties
that it is not meant to have. Instead it's a very flexible IL framework where
you can express a lot of things, unlike GIMPLE which is much more narrow.
--
Eric Botcazou