public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: "Flis\, Przemyslaw \(Nokia - PL\/Wroclaw\)" <przemyslaw.flis@nokia.com>
Cc: "gcc-help\@gcc.gnu.org" <gcc-help@gcc.gnu.org>
Subject: Re: Exception handling
Date: Mon, 29 May 2017 09:09:00 -0000	[thread overview]
Message-ID: <87vaokxc5k.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <VI1PR07MB31810694A9E69AA74DB08AF4E9F30@VI1PR07MB3181.eurprd07.prod.outlook.com>	(Przemyslaw Flis's message of "Mon, 29 May 2017 09:00:20 +0000")

"Flis, Przemyslaw (Nokia - PL/Wroclaw)" <przemyslaw.flis@nokia.com>
writes:

> as far as I know, the way of handling exceptions "under the hood" is
> not defined in C++ standard. In "Technical report on C++ performance "
> from 2008, I've found two main approaches to exception handling - so
> called "code" and "table" approach. Is there any way to determine
> which is used by gcc compiler? Does it depend on platform (i.e. ARM,
> x86 etc.) or compiler version?

It depends on architecture, compiler version, and how GCC is built for
those architectures which support both approaches.  I think the the
default for the vast majority of architectures is table-based.

> As far I understand "table" approach has almost zero time overhead
> when exception does not appear. But when it does, is this time
> overhead predictable? If it is, how to predict it?

The overhead is not really predictable, except in very special cases.
It can be huge in multi-threaded programs:

  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71744

Florian

  reply	other threads:[~2017-05-29  9:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-29  9:00 Flis, Przemyslaw (Nokia - PL/Wroclaw)
2017-05-29  9:09 ` Florian Weimer [this message]
2017-05-31  8:32 ` Andrew Haley
  -- strict thread matches above, loose matches on Subject: below --
2003-01-16 17:17 Exception Handling Ryan Cuprak
2003-01-17  7:15 ` Michal Lipták
2003-01-17 17:18   ` Oliver Kullmann
2003-01-16 17:16 Ryan Cuprak
2003-01-16 17:33 ` Nathan Sidwell

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=87vaokxc5k.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=przemyslaw.flis@nokia.com \
    /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).