From: "Rafal 'Raf256' Maj" Newsgroups: comp.os.msdos.djgpp Subject: -O3 doesnt remove dead code Date: 14 Sep 2002 12:34:04 GMT Organization: news.onet.pl Lines: 16 Sender: raf256 AT poczta DOT onet DOT pl@rafal.joint.eu.org Message-ID: NNTP-Posting-Host: rafal.joint.eu.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 8bit X-Trace: news.onet.pl 1032006844 22563 62.233.182.179 (14 Sep 2002 12:34:04 GMT) X-Complaints-To: abuse AT onet DOT pl NNTP-Posting-Date: 14 Sep 2002 12:34:04 GMT User-Agent: Xnews/5.03.24 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hello, Following program compield with -03 does NOT had dead-code loop removed. This empty loop actualy IS executed (and program takes few seconds to complete) int main() { for (long long int i=0; i<500000000; i++) ; return 0; } IMHO compiler at -O3 should optimize code to : int main() { return 0; } why this dead-loop is not removed ? -- Rafał 'Raf256' Maj http://www.raf256.com