NDEBUG-like macro
Bernd Schmidt
crux@pool.informatik.rwth-aachen.de
Thu Apr 16 01:44:00 GMT 1998
On Wed, 15 Apr 1998, Mark Mitchell wrote:
> In private email, Jeff and I have been discussing the following
> proposal:
>
> o Add a configuration option --enable-checking to enable additional,
> possibly costly, consistency checks in the compiler.
> The motivation for this is the disturbingly common situation in
> which I find that bugs are triggered by using, say, DECL_INITIAL on a
> tree node that is not a DECL. In general, the use of a macro that
> pulls something out of a tagged union when the tag doesn't match. It
> would be nice if we could blow up when we did this wrong.
The tree and rtl structures are terribly overloaded. Some of that checking
could be done at compile-time instead of at run-time, by introducing new
types. For example, it might be possible to distinguish between trees that
describe expressions and those that describe types instead of calling both
simply a "tree".
Of course such a change would require a lot more work.
Bernd
More information about the Gcc
mailing list