public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Joseph S. Myers" <joseph@codesourcery.com>
To: Eric Botcazou <ebotcazou@adacore.com>
Cc: Jan Hubicka <hubicka@ucw.cz>,
	gcc-patches@gcc.gnu.org,
	    Xinliang David Li <davidxl@google.com>
Subject: Re: [google]: initialize language field for clone function struct
Date: Tue, 03 May 2011 20:09:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.64.1105031954550.11522@digraph.polyomino.org.uk> (raw)
In-Reply-To: <201105032151.17713.ebotcazou@adacore.com>

On Tue, 3 May 2011, Eric Botcazou wrote:

> > In my view we should require front ends to take responsibility for
> > variable-size types, and get rid of this language-independent function
> > (copying such parts as are needed into the front ends that need them).
> 
> I don't really see the point here.  GCC supports variable-sized types in the 
> middle-end (stor-layout.c, gimplifier) so why special-casing this function?

In general errors from outside the front end, but relating to problems 
with the user's source code, are suspicious; the front end should detect 
invalid code, diagnose it and not pass it to the language-independent 
compiler.  And the exact language semantics regarding where variable-size 
types are permitted and when the sizes should be evaluated are inherently 
front-end-specific and not easily represented in a generic function.

convert.c is another place with errors that I think ought to go in the 
front ends; having some generic conversion logic is fine, but the front 
ends should deal with diagnosing invalid cases and convert.c should ICE if 
asked to do a conversion it doesn't know how to do.

> > C for example uses its own version as the language-independent one isn't
> > right for C.
> 
> The C version looks an almost exact duplicate of the generic one though.  We 
> should probably try to reconciliate the different versions.

C doesn't want the language-independent errors (see above); they don't 
reflect the right logic for C.  It needs to override parts of the generic 
function when called from generic code, and so to replace it when called 
from the front end.

C returns -1 from global_bindings_p, as does Ada.  That the languages that 
probably care most about variable-size types find aspects of the generic 
function need overriding like that should be a good indication that it 
isn't really that generic - as I said above, semantics for variable sizes 
are very front-end-specific.

-- 
Joseph S. Myers
joseph@codesourcery.com

  reply	other threads:[~2011-05-03 20:05 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-30  1:34 Xinliang David Li
2011-05-02 22:13 ` Xinliang David Li
2011-05-03 10:55   ` Jan Hubicka
2011-05-03 16:15     ` Xinliang David Li
2011-05-03 16:46       ` Jan Hubicka
2011-05-03 18:55         ` Eric Botcazou
2011-05-03 19:07           ` Joseph S. Myers
2011-05-03 19:16             ` Nathan Froyd
2011-05-03 19:51               ` Joseph S. Myers
2011-05-03 20:05                 ` Nathan Froyd
2011-05-03 19:52             ` Eric Botcazou
2011-05-03 20:09               ` Joseph S. Myers [this message]
2011-05-03 20:36                 ` Eric Botcazou
2011-05-03 21:27                   ` Joseph S. Myers
2011-05-04  8:53                     ` Eric Botcazou
2011-05-04 17:27                     ` Tom Tromey
2011-05-04  9:52       ` Richard Guenther
2011-05-04 10:02         ` Eric Botcazou
2011-05-04 10:30           ` Joseph S. Myers
2011-05-04 11:01             ` Eric Botcazou
2011-05-04 11:50             ` Richard Kenner
2011-05-04 12:23               ` Diego Novillo
2011-05-04 12:27                 ` Richard Kenner
2011-05-04 12:31                   ` Diego Novillo
2011-05-04 13:16                   ` Michael Matz
2011-05-04 13:22                   ` Nathan Froyd
2011-05-04 13:26                     ` Diego Novillo
2011-05-04 13:39                       ` Richard Kenner
2011-05-04 11:19           ` Richard Guenther
2011-05-04 12:00             ` Michael Matz
2011-05-04 12:08               ` Richard Guenther
2011-05-04 15:33             ` Eric Botcazou
2011-05-04 16:05               ` Richard Guenther
2011-05-04 17:22                 ` Eric Botcazou
2011-05-05  9:07                   ` Richard Guenther
2011-05-05  9:25                     ` Eric Botcazou
2011-05-05  9:44                       ` Richard Guenther
2011-05-05 10:22                         ` Eric Botcazou
2011-05-05 11:03                           ` Richard Guenther
2011-05-05 11:59                             ` Eric Botcazou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.1105031954550.11522@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=davidxl@google.com \
    --cc=ebotcazou@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).