This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Transform assertion into optimization hints
- From: Marc Glisse <marc dot glisse at inria dot fr>
- To: François Dumont <frs dot dumont at gmail dot com>
- Cc: "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 17 Sep 2018 23:15:04 +0200 (CEST)
- Subject: Re: Transform assertion into optimization hints
- References: <001a8c05-7674-6078-d4ec-087ecc109464@gmail.com>
On Mon, 17 Sep 2018, François Dumont wrote:
We talk about it a while back.
I've run testsuite several times since I have this patch on my local copy.
Note that when I implemented it the wrong way tests started to fail so it is
clearly having an effect on the generated code.
* include/bits/c++config [__OPTIMIZE__](__glibcxx_assert): Define as
optimization hint
using __builtin_unreachable.
Ok to commit ?
I see for instance in bits/regex_automaton.tcc:
__glibcxx_assert(__m.count(__ref._M_next) > 0);
where __m is a map, which does not look so well suited for a
__builtin_unreachable. Is it using the wrong macro?
--
Marc Glisse