delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2006/04/04/15:46:59

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: "Bob W" <dontsend AT operamail DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: new gcc 4.10 behaviour
Date: 4 Apr 2006 12:42:10 -0700
Organization: http://groups.google.com
Lines: 31
Message-ID: <1144179730.698662.116110@i39g2000cwa.googlegroups.com>
References: <1143542847 DOT 613686 DOT 87820 AT v46g2000cwv DOT googlegroups DOT com>
<48sjvaFlir4cU1 AT news DOT dfncis DOT de>
<48v4k4Fm65abU1 AT news DOT dfncis DOT de>
<48vd7eFm0rukU5 AT news DOT dfncis DOT de>
<6q6v225evfpih3nbj2ts20qre7br1i8an7 AT 4ax DOT com>
NNTP-Posting-Host: 84.102.38.22
Mime-Version: 1.0
X-Trace: posting.google.com 1144179736 23797 127.0.0.1 (4 Apr 2006 19:42:16 GMT)
X-Complaints-To: groups-abuse AT google DOT com
NNTP-Posting-Date: Tue, 4 Apr 2006 19:42:16 +0000 (UTC)
User-Agent: G2/0.2
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727),gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse AT google DOT com
Injection-Info: i39g2000cwa.googlegroups.com; posting-host=84.102.38.22;
posting-account=CXf2IQ0AAADhHwR4LIBYSPHMQKV3cPd3
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Brian Inglis wrote:

.............

>
> Then it's a bug, perhaps over zealous optimization,

..............

> It's also a suspicious coincidence that the poster reports a speed
> increase of 5 times, and that ticks are 18.2/sec but multiplied by 5
> so that CLK_TCK and CLOCKS_PER_SEC can be kept as an integral 91;
> perhaps the ticks are being multiplied by 5 elsewhere, as well as in
> clock.c?

As already mentioned elsewhere - the following happens:

- From the 1st optimisation level onwards gcc chooses to
modify Ack() which might get called more than once - unlike
the source code would suggest. Whether Ack() is called a
second time or not depends on the parameter supplied.

- If that happens, the 2nd clock() function call, which gcc
has placed between the Ack() calls, gets executed too early.
This seems to be the reason for the reported timing distortion
(aka "five-fold speed increase").

As a conclusion I'd rule out that clock ticks are multiplied
by 5 elsewhere. It is just a strange gcc optimisation attempt
which is obviously breaking the intended code sequence.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019