This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [RFC/PATCH] Optimize code based on asserts even in NDEBUG mode


> ISO C says assert expands to ((void)0) in NDEBUG mode, so you
> can't presume anything about the truth of the expression asserted
> afterwards.

So are other compilers in error assuming that the expression is true?

It would look like a worthwhile optimization in the presence of inlined
functions.

(Anyway if there is a way to make it a valid optimization, or if it is
acceptable to enable it with a switch, I think I'll redo it with treessa, it
is easier and cleaner there).

Paolo




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