This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C/gomp PATCH] Convert OMP_CLAUSE_IF_EXPR to boolean_type_node
On Fri, Mar 31, 2006 at 10:15:00AM -0700, Roger Sayle wrote:
> By this point in the middle-end, all implicit int->bool conversions
> are (could be) assumed to be truncations with the integer holding a
> zero or one value (or more accurately with the result in the least
> significant bit). Normally, for front-ends where this is not the case,
> such as the C/C++ family, the function c_common_truthvalue_conversion
> is invoked to produce an explicit "i != 0" NE_EXPR during lowering to
> GENERIC.
Which has happened here too: c_parser_omp_clause_if ->
c_parser_paren_condition -> c_objc_common_truthvalue_conversion.
> I hope this better explains my motivation, and now helps
> you see a good reason to do this here.
It clarifies nothing for me. Indeed, it solidifies in my
mind that the C omp if is doing the right thing, in that
it is producing *exactly* the same results for as the
native if conditional.
If you want to force C to produce a boolean_type_node for
all COND_EXPRs, that's something we can talk about, but it
is really a different topic.
r~