From 280931058a2f5beb7cebef0d5a0a6491c182cfb4 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Tue, 2 Dec 2014 09:03:44 +0000 Subject: [PATCH] match.pd: Restrict division combining to trunc_div and exact_div. 2014-12-02 Richard Biener * match.pd: Restrict division combining to trunc_div and exact_div. From-SVN: r218260 --- gcc/ChangeLog | 5 +++++ gcc/match.pd | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) 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 { -- 2.30.2