The function add_stmt in the shared C/C++ frontend has this
conditional in it:
if ((EXPR_P (t) || STATEMENT_CODE_P (code)) && code != LABEL_EXPR)
EXPR_P is true for any tree code of class tcc_statement or
tcc_expression, among others. STATEMENT_CODE_P will only return true
in the C++ frontend, for this list of codes:
CTOR_INITIALIZER, TRY_BLOCK, HANDLER, \
EH_SPEC_BLOCK, USING_STMT, TAG_DEFN, \
IF_STMT, CLEANUP_STMT, FOR_STMT, \
WHILE_STMT, DO_STMT, BREAK_STMT, \
CONTINUE_STMT, SWITCH_STMT, EXPR_STMT
Those codes all have class tcc_statement or tcc_expression. Therefore
EXPR_P will always return true for them, and the test of
STATEMENT_CODE_P is unnecessary. It seems very unlikely that
STATEMENT_CODE_P will ever return true for something which is not
tcc_statement or tcc_expression.
This obvious patch removes the test of STATEMENT_CODE_P. Tested with
bootstrap and testsuite run on i686-pc-linux-gnu. OK for mainline?