From: Richard Biener Date: Mon, 31 Aug 2015 14:00:16 +0000 (+0000) Subject: re PR tree-optimization/67381 (genmatch does not honor the order of patterns) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6974662928334fbca028b2e0fda30721f9fc8afc;p=gcc.git re PR tree-optimization/67381 (genmatch does not honor the order of patterns) 2015-08-31 Richard Biener PR middle-end/67381 * genmatch.c (dt_node::gen_kids): Also treat matches as barrier. From-SVN: r227344 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0e97a190a20..adc85fe964a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-08-31 Richard Biener + + PR middle-end/67381 + * genmatch.c (dt_node::gen_kids): Also treat matches as barrier. + 2015-08-31 Marc Glisse * match.pd (SIN, COS, TAN, COSH): Reorder for consistency. diff --git a/gcc/genmatch.c b/gcc/genmatch.c index d92d8080dd0..72666373740 100644 --- a/gcc/genmatch.c +++ b/gcc/genmatch.c @@ -2529,12 +2529,15 @@ dt_node::gen_kids (FILE *f, int indent, bool gimple) else gcc_unreachable (); } - else if (kids[i]->type == dt_node::DT_MATCH - || kids[i]->type == dt_node::DT_SIMPLIFY) + else if (kids[i]->type == dt_node::DT_SIMPLIFY) others.safe_push (kids[i]); - else if (kids[i]->type == dt_node::DT_TRUE) + else if (kids[i]->type == dt_node::DT_MATCH + || kids[i]->type == dt_node::DT_TRUE) { /* A DT_TRUE operand serves as a barrier - generate code now + for what we have collected sofar. + Like DT_TRUE, DT_MATCH serves as a barrier as it can cause + dependent matches to get out-of-order. Generate code now for what we have collected sofar. */ gen_kids_1 (f, indent, gimple, gimple_exprs, generic_exprs, fns, generic_fns, preds, others);