From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24488 invoked by alias); 13 Nov 2007 10:30:44 -0000 Received: (qmail 24471 invoked by uid 22791); 13 Nov 2007 10:30:42 -0000 X-Spam-Check-By: sourceware.org Received: from mu-out-0910.google.com (HELO mu-out-0910.google.com) (209.85.134.189) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 13 Nov 2007 10:30:17 +0000 Received: by mu-out-0910.google.com with SMTP id g7so1790889muf for ; Tue, 13 Nov 2007 02:30:15 -0800 (PST) Received: by 10.64.28.3 with SMTP id b3mr7645544qbb.1194949814057; Tue, 13 Nov 2007 02:30:14 -0800 (PST) Received: by 10.65.232.20 with HTTP; Tue, 13 Nov 2007 02:30:14 -0800 (PST) Message-ID: <84fc9c000711130230y5d56d07br33b83ce2c4e8cb94@mail.gmail.com> Date: Tue, 13 Nov 2007 11:18:00 -0000 From: "Richard Guenther" To: "Bernd Schmidt" Subject: Re: [PATCH] Fix PR34027, SCEV const-prop pessimizes -Os Cc: gcc-patches In-Reply-To: <4738EFF2.1010505@t-online.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <84fc9c000711110433x4c5fb5ebnfbb78cfac73f987a@mail.gmail.com> <4738EFF2.1010505@t-online.de> X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2007-11/txt/msg00696.txt.bz2 On Nov 13, 2007 1:29 AM, Bernd Schmidt wrote: > Richard Guenther wrote: > > With the now famous enough testcase > > > > unsigned long long foobar(unsigned long long ns) > > { > > while(ns >= 1000000000L) > > ns -= 1000000000L; > > return ns; > > } > > > > SCEV const-prop creates the expression > > > > ns + (ns /[fl] 1000000000L) / -1000000000L > > > > for the final value of ns > > Am I the only one here who thinks this is a spectacularly bad idea? > Divisions are expensive, especially on targets without hardware divide. No you are not ;) In fact the kernel people complained about this already. Richard.