On 06/30/2015 03:06 AM, Eric Botcazou wrote: >> I notice the way gcc_assert() is defined in system.h now, the test won't >> disappear even when runtime checks are disabled, though you might still >> adjust it to avoid any programmer confusion. > > It will disappear at run time, see the definition: > > /* Include EXPR, so that unused variable warnings do not occur. */ > #define gcc_assert(EXPR) ((void)(0 && (EXPR))) > > so you really need to use a separate variable. Oh, yuck -- it never even occurred to me that gcc_assert could be disabled. I'll bet there are other bugs in GCC due to this very same problem of depending on its argument being executed for side-effect. (E.g. take a look at add_stmt_to_eh_lp_fn in tree-eh.c.) Seems like lousy design to me especially since proper usage doesn't seem to be documented anywhere. Anyway, I think the attached patch is what's required to fix the instance that's my fault. OK? Bernd, if this needs testing, can you help? -Sandra