This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] Have assert macros
- From: Dale Johannesen <dalej at apple dot com>
- To: Mark Mitchell <mark at codesourcery dot com>
- Cc: Nathan Sidwell <nathan at codesourcery dot com>, gcc <gcc at gcc dot gnu dot org>
- Date: Tue, 24 Aug 2004 15:39:47 -0700
- Subject: Re: [RFC] Have assert macros
- References: <412A49D5.2070809@codesourcery.com> <412BC054.7060409@codesourcery.com>
On Aug 24, 2004, at 3:25 PM, Mark Mitchell wrote:
Nathan Sidwell wrote:
Hi,
I did some measurements to determine how much leaving in our self
checking
mechanism of the form
if (expr)
abort()
was costing us in compilation speed. I built 4 --disable-checking
compilers, with the following tweaks
0) baseline
1) #define abort to no-op, thus allowing the optimizer can remove the
controlling expression
2) #define abort to no-op and g++'s my_friendly_assert to no-op
Redefining abort is undefined behavior in C89 (4.1.2.1, footnote 91).
Of course we can switch to using gcc_abort, appropriately #define'd.