__assert_fail should not be __attribute__((__noreturn__))

Richard Henderson rth@twiddle.net
Mon Apr 5 17:30:00 GMT 2004


On Sun, Apr 04, 2004 at 10:46:09PM -0400, Daniel Jacobowitz wrote:
> > I do not propose to change assert() (the public interface) nor the 
> > implementation in libc. Moreover, I don't see the _performace_ hit if the 
> > penalty is in code that by default is never reached. So, I don't see that 
> > everybody would be hurt. What's the problem?
> 
> 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.


r~



More information about the Libc-alpha mailing list