On Fri, Aug 09, 2024 at 11:01:22AM -0400, Jason Merrill wrote: > > The CLEANUP_POINT_EXPR gets added by the following call chain: > > > > finish_while_stmt_cond > > -> maybe_convert_cond > > -> condition_conversion > > -> fold_build_cleanup_point_expr > > > > this patch chooses to fix the issue in maybe_convert_cond by walking through > > any ANNOTATE_EXPRs and doing any condition conversion on the inner > > expression, > > leaving the ANNOTATE_EXPRs (if any) as the outermost expressions in the > > condition. > > I see that simplify_loop_decl_cond and finish_loop_cond use this same > pattern. OK.
I'm a little bit worried about the convert_from_reference in there. Shouldn't TREE_TYPE of ANNOTATE_EXPR always match the TREE_TYPE of its operand? If it could be say REFERENCE_TYPE to BOOLEAN_TYPE, convert_from_reference could change it but with the patch fail to adjust the type. Jakub