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 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~


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