From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10612 invoked by alias); 30 Sep 2006 20:04:08 -0000 Received: (qmail 10603 invoked by uid 22791); 30 Sep 2006 20:04:07 -0000 X-Spam-Check-By: sourceware.org Received: from romy.inter.net.il (HELO romy.inter.net.il) (192.114.186.66) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 30 Sep 2006 20:04:05 +0000 Received: from [83.130.134.215] (IGLD-83-130-134-215.inter.net.il [83.130.134.215]) by romy.inter.net.il (MOS 3.7.3-GA) with ESMTP id FWX08883 (AUTH dlivshin); Sat, 30 Sep 2006 23:04:00 +0300 (IDT) Message-ID: <451ECDE2.9060703@dalsoft.com> Date: Sat, 30 Sep 2006 20:04:00 -0000 From: David Livshin User-Agent: Thunderbird 1.5 (X11/20051201) MIME-Version: 1.0 To: =?UTF-8?B?QXJ0xatyYXMgTW9za3ZpbmFz?= CC: gcc-help@gcc.gnu.org Subject: Re: how to generate code-loops References: <451E73B3.70309@dalsoft.com> <5b7094580609300655t51321877vecc5aa134ad8f2ce@mail.gmail.com> <451EB9BE.6030006@dalsoft.com> <451ECAB5.2090002@gmail.com> In-Reply-To: <451ECAB5.2090002@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2006-09/txt/msg00345.txt.bz2 Artūras Moskvinas wrote: >>> a) It looks like a loop to me. >>> >> No it is not a loop, at least not a loop I would like to have. Perhaps I >> had to mention this in my message, but the boy of the "loop" should be a >> basic block ( no jump to/from it ) - the code generated is not a such. >> > for loop before doing any instructions must check conditions and then > perform statements inside it. So your code is not right (there is no > check for conditions before starting the loop)(though sometimes it is > correct). > > The code in my posting is only small portion of the code generated; just to illustrate the problem. > Label: > > conditional jump to 'Label' > > You might consider using: > do > { > code > } while (condition not satisfied) > > > >>> b) You instructed the compiler to unroll all loops, which is >>> apparently what it did. >>> >> Maybe I'm confused about what you are asking? >> > > You forced gcc compiler to unroll all loops in your code even if it > makes performance lower. "-funroll-all-loops" > >From gcc manual: > "-funroll-all-loops" Unroll all loops, even if their number of > iterations is uncertain when the loop is entered. This usually makes > programs run more slowly. > http://gcc.gnu.org/onlinedocs/gcc-4.1.1/gcc/Optimize-Options.html#Optimize-Options > > Try switching that setting of. > > Arturas M > I would like to have unrolled "real loop". -- David Livshin david.livshin@dalsoft.com http://www.dalsoft.com