Hello, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80887#c10 for the context. FRE can go into an infinite recursion with some match.pd simplifications (that have been temporarily reverted). Limiting the depth of recursive calls is not a great solution, but it is simple and I don't have a good idea for an alternate solution that does not disable a lot of desirable optimizations. There are many ways to write the limiter, I went with depth_limiter d; if (d > 100) return false; but I could also have written the class so the use would look like depth_limiter d(100); if (!d) return false; for instance. 100 was picked arbitrarily, I don't think it is worth having a param for it, but we could certainly use a different value. Bootstrap and testsuite on powerpc64le-unknown-linux-gnu. 2017-06-19 Marc Glisse * gimple-match-head.c (depth_limiter): New class. * genmatch.c (decision_tree::gen): Use it. -- Marc Glisse