comp.lang.ada
 help / color / mirror / Atom feed
From: deadlyhead <deadlyhead@gmail.com>
Subject: Re: Timing code blocks
Date: Fri, 5 Mar 2010 00:16:52 -0800 (PST)
Date: 2010-03-05T00:16:52-08:00	[thread overview]
Message-ID: <12e4d91f-9c23-49fb-a413-97c0375a1668@s36g2000prf.googlegroups.com> (raw)
In-Reply-To: 13j6juslcud2k.1n4jnpj74p3k$.dlg@40tude.net

On Mar 4, 11:55 pm, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
wrote:
>
> This is an ancient bug, which managed to survive a number of GNAT compiler
> versions.
>
> As a workaround, add delay 0.0 at the beginning of your program:
>
> > ----------------------------------------------------------------------
>
> > --  A test of the cost of conditionals
>
> > with Ada.Text_IO;  use Ada.Text_IO;
> > with Ada.Real_Time; use Ada.Real_Time;
> > procedure Conditional_Test is
>

Exactly what was needed.  Thank you!

Do you happen to know if this bug has been fixed in the current
development branch? (At home I compile GNAT based on GCC 4.4, but
haven't done any real-time tests with it yet.) This seems like an
unfortunate bug to have lying around in an otherwise respected
compiler. The ease of the workaround, and likewise that it seems so
pointless to have to insert a dummy delay statement, would lead many
to believe that this bug was just a sloppy error, even if the real
reasons it exists are somewhat more complex.

BTW, my test results with -O3 and -Os, there is no difference in
performance between the two loops, and -Os produces code that is about
33% faster than -O3.  With -O0, the second loop is faster by an
average of 10%.  I would have thought the extra conditional would have
been costlier.

Again, thanks for the reply!
-- deadlyhead



  reply	other threads:[~2010-03-05  8:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-05  6:34 Timing code blocks deadlyhead
2010-03-05  7:55 ` Dmitry A. Kazakov
2010-03-05  8:16   ` deadlyhead [this message]
2010-03-05  8:49     ` Dmitry A. Kazakov
2010-03-05 12:41       ` Alex Mentis
2010-03-05 21:15         ` Jeffrey R. Carter
2010-03-05 23:35         ` Simon Wright
2010-03-06  9:50           ` Georg Bauhaus
2010-03-06 12:06             ` Simon Wright
2010-03-07  1:02               ` Georg Bauhaus
2010-03-08 12:16                 ` Alex Mentis
2010-03-06 12:12           ` Alex Mentis
2010-03-05  8:33   ` Ludovic Brenta
2010-03-05  9:04     ` Dmitry A. Kazakov
2010-03-05 15:27       ` Reporting bugs (was: Timing code blocks) Ludovic Brenta
2010-03-06  7:13         ` Stephen Leake
2010-03-05 23:35   ` Timing code blocks Simon Wright
2010-03-05  8:21 ` Niklas Holsti
2010-03-05 20:17   ` Simon Wright
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox