diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8924c7aa95e..aed08f43299 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2014-12-02 Richard Biener + + * match.pd: Restrict division combining to trunc_div and + exact_div. + 2014-12-02 Jakub Jelinek * config/sparc/sparc.c (sparc_atomic_assign_expand_fenv): diff --git a/gcc/match.pd b/gcc/match.pd index ee9bbc65faf..b36aa2fe76a 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -129,8 +129,9 @@ along with GCC; see the file COPYING3. If not see && TYPE_UNSIGNED (type)) (trunc_div @0 @1))) -/* Combine two successive divisions. */ -(for div (trunc_div ceil_div floor_div round_div exact_div) +/* Combine two successive divisions. Note that combining ceil_div + and floor_div is trickier and combining round_div even more so. */ +(for div (trunc_div exact_div) (simplify (div (div @0 INTEGER_CST@1) INTEGER_CST@2) (with {