This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Disable bounds checking for edge iterators in release compiler
- From: Manuel López-Ibáñez <lopezibanez at gmail dot com>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 8 Jun 2010 11:23:18 +0200
- Subject: Re: Disable bounds checking for edge iterators in release compiler
- References: <20100608071707.GB8913@kam.mff.cuni.cz>
On 8 June 2010 09:17, Jan Hubicka <hubicka@ucw.cz> wrote:
> Hi,
> oprofile shows as one of highest sample count the following sanity check:
> ? ? ? ? ? ? ? :/* Advance the iterator to the next element. ?*/
> ? ? ? ? ? ? ? :static inline void
> ? ? ? ? ? ? ? :ei_next (edge_iterator *i)
> ? ? ? ? ? ? ? :{
> ?6578 ?0.4915 : ?gcc_assert (i->index < EDGE_COUNT (ei_container (*i)));
> ? 201 ?0.0150 : ?i->index++;
> ? ? ? ? ? ? ? :}
>
> I guess it is mostly cache miss that would be later attributed elsewhere, but
> it also seems to me that this kind of bounds checking is something we want to
> omit in release compiler (same was as we disable VEC range checking and such).
> The probability that we will get useful error here is relatively low compared
> to amount of checks we spread across compiler by inlining the function.
Why is not gcc_assert a NOP without ENABLE_CHECKING? I was pretty sure
it was and hence I was using it very liberally.
I wonder what the performance of the compiler would be in that case.
Cheers,
Manuel