From: Jonathan Wakely <jwakely@redhat.com>
To: "François Dumont" <frs.dumont@gmail.com>
Cc: Jonathan Wakely <jwakely.gcc@gmail.com>,
"libstdc++@gcc.gnu.org" <libstdc++@gcc.gnu.org>,
gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: vector lightweight debug mode
Date: Wed, 07 Oct 2015 20:09:00 -0000 [thread overview]
Message-ID: <20151007200917.GU12094@redhat.com> (raw)
In-Reply-To: <561574BE.1060005@gmail.com>
On 07/10/15 21:38 +0200, François Dumont wrote:
>Hi
>
> I completed vector assertion mode. Here is the result of the new
>test you will find in the attached patch.
>
>With debug mode:
>/home/fdt/dev/gcc/build_git/x86_64-unknown-linux-gnu/libstdc++-v3/include/debug/safe_iterator.h:375:
>Error: attempt to advance a dereferenceable (start-of-sequence) iterator 2
>steps, which falls outside its valid range.
>
>Objects involved in the operation:
> iterator @ 0x0x7fff1c346760 {
> type =
>__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<int*,
>std::__cxx1998::vector<int, std::allocator<int> > >,
>std::__debug::vector<int, std::allocator<int> > > (mutable iterator);
> state = dereferenceable (start-of-sequence);
> references sequence with type 'std::__debug::vector<int,
>std::allocator<int> >' @ 0x0x7fff1c3469a0
> }
>XFAIL: 23_containers/vector/debug/insert8_neg.cc execution test
>
>
>With assertion mode:
>/home/fdt/dev/gcc/build_git/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/stl_vector.h:1124:
>Error: invalid insert position outside container [begin, end) range.
>
>Objects involved in the operation:
> sequence "this" @ 0x0x7fff60b1f870 {
> type = std::vector<int, std::allocator<int> >;
> }
> iterator "__position" @ 0x0x7fff60b1f860 {
> type = __gnu_cxx::__normal_iterator<int const*, std::vector<int,
>std::allocator<int> > >;
> }
>XFAIL: 23_containers/vector/debug/insert8_neg.cc execution test
I still don't like the formatted output for the lightweight mode, it
adds a dependency on I/O support in libc, which is a problem for
embedded systems.
The idea was to just add really cheap checks and abort :-(
Have you compared codegen with and without assertion mode? How much
more code is added to member functions like operator[] that must be
inlined for good performance? Is it likely to affect inlining
decisions?
I suspect it will have a much bigger impact than if we just use
__builtin_abort() as I made it do originally.
If these checks become more complex then people are not going to
enable them by default, and we probably won't want to make them
enabled by _FORTIFY_SOURCE.
next prev parent reply other threads:[~2015-10-07 20:09 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-14 18:30 François Dumont
2015-09-14 19:55 ` Jonathan Wakely
2015-09-16 19:43 ` François Dumont
2015-09-16 20:53 ` Jonathan Wakely
[not found] ` <CA+jCFLueUi0Zo4m2D-scXNG5JLVSObKbJgXWaQRJrQ+notbXzg@mail.gmail.com>
2015-09-17 21:14 ` Fwd: " Christopher Jefferson
2015-09-19 9:12 ` Jonathan Wakely
2015-09-19 9:09 ` François Dumont
2015-09-19 9:48 ` Jonathan Wakely
2015-09-19 12:00 ` Jonathan Wakely
2015-10-07 19:38 ` François Dumont
2015-10-07 20:09 ` Jonathan Wakely [this message]
2015-10-12 19:43 ` François Dumont
2015-11-15 21:12 ` François Dumont
2015-11-16 10:29 ` Jonathan Wakely
2015-11-17 19:49 ` François Dumont
2015-11-18 12:27 ` Jonathan Wakely
2015-11-18 12:34 ` Jonathan Wakely
2015-11-19 21:17 ` François Dumont
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=20151007200917.GU12094@redhat.com \
--to=jwakely@redhat.com \
--cc=frs.dumont@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jwakely.gcc@gmail.com \
--cc=libstdc++@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).