This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Disable bounds checking for edge iterators in release compiler


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]