From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16735 invoked by alias); 11 Dec 2008 00:43:43 -0000 Received: (qmail 14010 invoked by uid 48); 11 Dec 2008 00:42:10 -0000 Date: Thu, 11 Dec 2008 00:43:00 -0000 Message-ID: <20081211004210.14008.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug tree-optimization/32044] [4.3/4.4 Regression] final value replacement too aggressive for e.g. targets with no native div/mod insns In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "mmitchel at gcc dot gnu dot org" 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 X-SW-Source: 2008-12/txt/msg01116.txt.bz2 ------- Comment #62 from mmitchel at gcc dot gnu dot org 2008-12-11 00:42 ------- I take Zdenek's point about the transformation from division to a loop being profitable only if x is small. But, that might argue that if we see the loop, we still transform it into the division form -- but with a note that allows the value-profiling code to turn it back. The advantage to that is we can then take advantage of the fact that it's division otherwise; for example, CSE it with a manually written division, or eliminate it if multiplied by the same value we divided by, etc. There are a bunch of issues somewhat tangled up in here. In any case, I am also concerned about the fact that if the user writes division and modulus manually, we're not taking advantage of the ABI divmod function. IIUC, it sounds like we could fix that by having the ARM back end always use the divmod function as on x86. Is that right? -- Mark -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32044