public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Doug Gregor" <doug.gregor@gmail.com>
To: "Brooks Moses" <brooks.moses@codesourcery.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH, C++] Make Canonical ICE instead of just warn when mismatching
Date: Fri, 05 Jan 2007 14:13:00 -0000	[thread overview]
Message-ID: <24b520d20701050613h10bddaceu567ee42e6b4e111f@mail.gmail.com> (raw)
In-Reply-To: <459DC221.4030201@codesourcery.com>

On 1/4/07, Brooks Moses <brooks.moses@codesourcery.com> wrote:
> My impression from your argument is that this case is not like that;
> that here we know that a failure to pass this particular internal check
> will never result in invalid code.  And thus a warning is appropriate
> here, because the user will still get valid usable code if they ignore
> the warning.
>
> Is this a correct impression?  I haven't seen any mention of this
> distinction, but it seems to me that it's the only way that the argument
> for a warning instead of a hard error would make sense.

Yes, your impression is correct.

The canonical types implementation is a compile-time optimization that
makes comparing types for equality (e.g., is "int*" the same as
"my_int_t*"?) faster. Previously, we would have to look at the
structure of the types to determine if they are equivalent; with
canonical types, we only do a single pointer comparison. However, the
code that looks at the structure of types is still needed for some
comparisons, so it's still available for us to use when checking.

As it stands now, there is a parameter "verify-canonical-types". When
it is zero (the default for --disable-checking builds), we trust the
canonical type system to be correct and get our 5-10% speedup on
template-heavy code. When it is one (the default for --enable-checking
builds), we compare the results of the older, slower structure-based
comparison against the results of the canonical type comparison. If
they differ, we complain. Then, we can recover from the failure of the
canonical-types system by reporting the result that the
structure-based comparison determined.

  Cheers,
  Doug

  reply	other threads:[~2007-01-05 14:13 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-04  5:30 Andrew_Pinski
2007-01-04 19:23 ` Mike Stump
2007-01-04 21:00   ` Andrew_Pinski
2007-01-04 22:26     ` Doug Gregor
2007-01-06  8:25       ` Eric Botcazou
2007-01-04 22:36     ` Mike Stump
2007-01-04 23:44       ` Andrew_Pinski
2007-01-04 23:48         ` Daniel Jacobowitz
2007-01-04 23:59           ` Andrew Pinski
2007-01-05  0:03             ` Daniel Jacobowitz
2007-01-05  0:17               ` Andrew_Pinski
2007-01-05  6:44                 ` Gabriel Dos Reis
2007-01-05 14:14                   ` Doug Gregor
2007-01-05 14:16                   ` Richard Kenner
2007-01-05  6:41             ` Gabriel Dos Reis
2007-01-05  2:04         ` Mike Stump
2007-01-05  3:13           ` Brooks Moses
2007-01-05 14:13             ` Doug Gregor [this message]
2007-01-05 14:20               ` Richard Guenther
2007-01-05 14:35                 ` Doug Gregor
2007-01-05 19:04                 ` Mike Stump
2007-01-05 19:12                   ` Richard Guenther
2007-01-08  5:14                   ` Andrew Pinski
2007-01-05  6:35   ` Gabriel Dos Reis
2007-01-05  6:33 ` Gabriel Dos Reis
2007-01-23  3:41   ` Mark Mitchell

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=24b520d20701050613h10bddaceu567ee42e6b4e111f@mail.gmail.com \
    --to=doug.gregor@gmail.com \
    --cc=brooks.moses@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    /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).