Here is an untested patch for that. Except that the middle-end considers conversions between BOOLEAN_TYPE and single bit unsigned type as useless, so in theory this can't work well, and in practice only if we are lucky enough (plus it generates terrible code right now), so we'd probably need to come up with a different way of expressing whether the internal fn should have a bool/_Bool-ish behavior or not (optional 3rd argument or something ugly like that). Plus add lots of testcases to cover the weirdo cases. Is it really worth it, even when we don't want to support overflow into enumeration type and thus will not cover all integral types anyway?
If it's cumbersome to get to work I agree that it's not worth the effort. Thanks for taking the time to prototype it. Martin