From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 51216 invoked by alias); 15 May 2015 18:07:12 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 51140 invoked by uid 48); 15 May 2015 18:07:08 -0000 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/64454] optimize (x%5)%5 Date: Fri, 15 May 2015 18:07:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-05/txt/msg01210.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64454 --- Comment #13 from Andrew Pinski --- (In reply to Marc Glisse from comment #12) > One last thing that would have been nice: in VRP, if the range of X is > included in [10,14], X%5 can be simplified to X-10. But it is probably not > worth the trouble. It might also be useful if the range is [0,10] for x%5 to be simplified down to just "t = x-5; x>=5?t:x;" And yes this shows up in some places; mainly dealing with character digit to number conversions.