Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!newsfeed.straub-nv.de!news-1.dfn.de!news.dfn.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Wojtek Lerch Newsgroups: comp.std.c Subject: Re: Loop Invariance Optimization Opportunity? Date: Fri, 18 Jan 2013 12:25:16 -0500 Lines: 8 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net j8pnaJt8En5pcDTgZhT65wND3b/qmZN2RAJQR+qqiU9bPyOyaiOWgijEBlehmWRtGA Cancel-Lock: sha1:6F9k9HUHRTl/CHpog+1ykLvEK7Y= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 In-Reply-To: Xref: csiph.com comp.std.c:1855 On 18-Jan-13 8:25 AM, Shao Miller wrote: > GCC without an -O, with -O2, and with -O3 didn't make any difference in > the behaviour. If an invariance optimization is used, the loop should > iterate 42 times, instead of 21. Have you tried you moving "looper" into a separate translation unit? I'm getting 42 with GCC 4.4.2, but 21 with GCC 4.6.3.