From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Paris Subject: Re: [2.6.37-rc1] Build failure: __divdi3 Date: Fri, 05 Nov 2010 13:41:45 -0400 Message-ID: <1288978905.20262.62.camel@localhost.localdomain> References: <201011050859.oA58xgCS071292@www262.sakura.ne.jp> <20101105090925.1f6e4b00.rdunlap@xenotime.net> <201011060148.AHA93123.FHOOMJSLtFFVOQ@I-love.SAKURA.ne.jp> <1288976127.20262.58.camel@localhost.localdomain> <201011060208.JFJ39521.HFQLOVtFOSJOMF@I-love.SAKURA.ne.jp> <201011060216.GCF30239.OOLMVQSHtFFOFJ@I-love.SAKURA.ne.jp> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: rdunlap@xenotime.net, akpm@linux-foundation.org, jmorris@namei.org, linux-fsdevel@vger.kernel.org To: Tetsuo Handa Return-path: Received: from mx1.redhat.com ([209.132.183.28]:60187 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754638Ab0KERl7 (ORCPT ); Fri, 5 Nov 2010 13:41:59 -0400 In-Reply-To: <201011060216.GCF30239.OOLMVQSHtFFOFJ@I-love.SAKURA.ne.jp> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Sat, 2010-11-06 at 02:16 +0900, Tetsuo Handa wrote: > Tetsuo Handa wrote: > > Eric Paris wrote: > > > Interesting, is this a result of the compiler previously being able to > > > optimize the division since it could tell it was a power of 2 and now > > > that we have a private variable it can't? The patch can easily be > > > reverted without breaking anyone else.... > > > I meant to say that it seems that GCC 3.x can optimize > > #define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) > > for roundup((long long), (const)) case but cannot optimize > > #define roundup(x, y) ( \ > { \ > typeof(y) __y = y; \ > (((x) + (__y - 1)) / __y) * __y; \ > } \ > ) > > for roundup((long long), (const)) case. I guess this is my fault (I'm not completely convinced) since my testing was done with gcc 4. I just retested to make sure that gcc-4.5.1-4.fc14.x86_64 is able to optimize both (and it does). Is the fact that it requires compiler optimizations for the code to build a good thing? -Eric