We fail to warn for gsi_replace (&gsi, call, GSI_SAME_STMT); with extern bool gsi_replace (gimple_stmt_iterator *, gimple *, bool); and enum gsi_iterator_update { GSI_NEW_STMT, /* Move the iterator to the first statement added. */ GSI_SAME_STMT, /* Leave the iterator at the same statement. */ GSI_CONTINUE_LINKING /* Move iterator to whatever position is suitable for linking other statements in the same direction. */ }; presumably because GSI_SAME_STMT is 1
Confirmed with the test case below: $ cat pr102726.C && gcc -S -Wall pr102726.C void f (bool); enum { E0, E1, E2 }; void f (void) { f (E0); // missing warning f (E1); // missing warning f (E2); // -Wint-in-bool-context } pr102726.C: In function ‘void f()’: pr102726.C:9:6: warning: enum constant in boolean context [-Wint-in-bool-context] 9 | f (E2); // -Wint-in-bool-context | ^~