When match-and-simplify simplification fails we have to release
eventually pushed stmts.
PR middle-end/125146
* gimple-fold.cc (fold_stmt_1): Discard stmts in seq
after failed gimple_simplify as well.
gimple_seq seq = NULL;
gimple_match_op res_op;
if (gimple_simplify (stmt, &res_op, inplace ? NULL : &seq,
- valueize, valueize))
- {
- if (replace_stmt_with_simplification (gsi, &res_op, &seq, inplace,
- dce_worklist))
- changed = true;
- else
- gimple_seq_discard (seq);
- }
+ valueize, valueize)
+ && replace_stmt_with_simplification (gsi, &res_op, &seq, inplace,
+ dce_worklist))
+ changed = true;
+ else
+ gimple_seq_discard (seq);
}
stmt = gsi_stmt (*gsi);