This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc 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: __assert_fail should not be __attribute__((__noreturn__))


On Montag, 5. April 2004 19:30, Richard Henderson wrote:
> On Sun, Apr 04, 2004 at 10:46:09PM -0400, Daniel Jacobowitz wrote:
> > You might want to look at what GCC can use the noreturn marker for.
> > Branch prediction and block reordering, for instance.
>
> Actually, the most important thing is that GCC can prove that the
> assert condition is false after the assertion.  This knowledge gets
> propagated into following statements.

These optimization opportunities are only available if assert() is used, but 
NDEBUG is _not_ used. That is, the optimzed code is payed with the runtime 
needed to evaluate the condition.

This makes no sense to me. I still think that if performance is needed, 
-DNDEBUG is the best optimization.

Is there so much software that benefits from unelided assert() expressions 
that removing noreturn is not an option?

-- Hannes


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