This adds a dispatch from fold_stmt (!inplace for now) to match-and-simplify. Mainly to get more testing coverage.
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied. Richard. 2014-05-15 Richard Biener <rguent...@suse.de> * gimple-fold.c (fold_stmt_1): Dispatch to gimple_match_and_simplify. Index: gcc/gimple-fold.c =================================================================== --- gcc/gimple-fold.c (revision 210414) +++ gcc/gimple-fold.c (working copy) @@ -1393,6 +1393,13 @@ fold_stmt_1 (gimple_stmt_iterator *gsi, } } + /* Dispatch to pattern-based folding. + ??? Do this after the previous stuff as fold_stmt is used to make + stmts valid gimple again via maybe_fold_reference of ops. */ + if (!inplace + && gimple_match_and_simplify (gsi, NULL)) + changed = true; + return changed; }