The purpose of an assert directive is to increase the likelihood that an unexpected condition will be detected. Having a compiler use false assertions for dead path elimination rather than trapping would cause them to have the opposite effect. For example...
int test1(int x, int *arr)
{
if (x < 10)
{ arr[x]++; return 0; }
else
return -1;
}
void test2(int x, int *arr)
{
assert(x < 10);
if (test1(x, arr))
fprintf(stderr, "test1() was unhappy!");
}
If code is generated for the asserts, calls with values of x greater than 10 will get reported. Such calls will also generate diagnostic output if asserts simply do nothing. If asserts were used for dead-path elimination, however, a compiler might stifle all of the checks that x was less than 10, thus causing such a condition to go undetected.
It might be useful to have a version of assert which a compiler could process or not at its leisure, since in some cases adding code to handle an assert would relieve a compiler from having to handle the conditions downstream. Having an assert trigger dead path elimination without a trap, however, seems like a really bad idea.