This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] cse.c: gcc_assertify an "if" statement whose conditionis always false.
Hi Mark,
> I dunno, I like asserts -- they document the assumption. But, there's
> no point in guarding ggc_assert with ENABLE_CHECKING, as ggc_assert
> already is conditionalized on that macro. OK with that change.
Actually, gcc_assert is guarded with ENABLE_ASSERT_CHECKING, not
ENABLE_CHECKING. In other words, if we don't guard this gcc_assert
with ENABLE_CHECKING, a release version of GCC would basically have
if (x == 0)
fancy_abort (...);
The idea is to keep the assertion while we are developing GCC and omit
it when we release it, so I'd like to go with either my original patch
or Jakub's idea of droping the whole "if" statement.
--enable-checking=release, which will presumably be default on a
release, will have ENABLE_ASSERT_CHECKING, but not ENABLE_CHECKING.
On a development branch or mainline, we have both
ENABLE_ASSERT_CHECKING and ENABLE_CHECKING.
Kazu Hirata