comp.lang.ada
 help / color / mirror / Atom feed
* volatile with gnat
@ 2001-01-10  2:32 Wayne Bullaughey
  2001-01-10 22:00 ` Robert Dewar
  0 siblings, 1 reply; 5+ messages in thread
From: Wayne Bullaughey @ 2001-01-10  2:32 UTC (permalink / raw)


The volatile pragma seems to be ignored by gnat version 3.13p when
optimization O2 is set unless I am missing something. All the versions of
gnat I have tried including Linux Intel native, NT Intel native, Solaris
Sparc native, Linux Intel X MIPS cross generate similar code. The following
source exhibits the problem:
procedure vol is

x : integer;


pragma Volatile (x);


begin

x := 0;

while x = 0 loop

null;

end loop;

end vol;

The NT Intel code generated is:

vol.o:     file format pe-i386

Disassembly of section .text:

00000000 <__ada_vol>:
   0: 55              pushl  %ebp
   1: 89 e5           movl   %esp,%ebp
   3: 83 ec 04        subl   $0x4,%esp
   6: c7 45 fc 00 00  movl   $0x0,0xfffffffc(%ebp)
   b: 00 00
   d: 8b 45 fc        movl   0xfffffffc(%ebp),%eax
  10: 85 c0           testl  %eax,%eax
  12: 75 08           jne    1c <__ada_vol+1c>
  14: 8b 45 fc        movl   0xfffffffc(%ebp),%eax
  17: 90              nop
  18: 85 c0           testl  %eax,%eax
  1a: 74 fc           je     18 <__ada_vol+18>
  1c: 89 ec           movl   %ebp,%esp
  1e: 5d              popl   %ebp
  1f: c3              ret


The generated code loads x into a register and then tests the register value
in the loop. My understanding of the volatile pragma is that the register
must be reloaded from the memory location. Version 3.11p generated correct
code.  I have not tried 3.12p. In my actual application I use a for
x'address use statement to map x to special hardware address that I need to
test.  Having this type of clause does not seem to affect the generated
code.

My apologies if this is the wrong forum for discussing gnat specific issues.
Is there a more appropriate place? I will also submit this to Act.

Wayne Bullaughey





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: volatile with gnat
  2001-01-10  2:32 volatile with gnat Wayne Bullaughey
@ 2001-01-10 22:00 ` Robert Dewar
  2001-01-11  0:59   ` wayne
  0 siblings, 1 reply; 5+ messages in thread
From: Robert Dewar @ 2001-01-10 22:00 UTC (permalink / raw)


In article <8RP66.4566$Gf6.42244@news3.voicenet.com>,
  "Wayne Bullaughey" <wayneb@cacdsp.com> wrote:
> I will also submit this to Act.

No need, this was found and fixed a while ago, The fix will
be in version 3.14


Sent via Deja.com
http://www.deja.com/



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: volatile with gnat
  2001-01-10 22:00 ` Robert Dewar
@ 2001-01-11  0:59   ` wayne
  2001-01-11  2:22     ` Robert Dewar
  0 siblings, 1 reply; 5+ messages in thread
From: wayne @ 2001-01-11  0:59 UTC (permalink / raw)


In article <93im24$jor$1@nnrp1.deja.com>,
  Robert Dewar <robert_dewar@my-deja.com> wrote:
>
> No need, this was found and fixed a while ago, The fix will
> be in version 3.14
>
I realize this is asking for the kind of information Act provides
paying customers but is there any place that reported problems for the
public version of Gnat is made publicly available?


Sent via Deja.com
http://www.deja.com/



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: volatile with gnat
  2001-01-11  0:59   ` wayne
@ 2001-01-11  2:22     ` Robert Dewar
  2001-01-11 18:13       ` Ted Dennison
  0 siblings, 1 reply; 5+ messages in thread
From: Robert Dewar @ 2001-01-11  2:22 UTC (permalink / raw)


In article <93j0go$t6k$1@nnrp1.deja.com>,
  wayne@wmi.com wrote:
> I realize this is asking for the kind of information Act
> provides paying customers but is there any place that
> reported problems for the public version of Gnat is made
> publicly available?

Not at the moment, but when GNAT becomes part of the gcc tree,
then presumably people will report bugs on the public version
using the standard gcc bug reporting mechanisms -- that's the
idea anyway -- we will see how it works out.


Sent via Deja.com
http://www.deja.com/



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: volatile with gnat
  2001-01-11  2:22     ` Robert Dewar
@ 2001-01-11 18:13       ` Ted Dennison
  0 siblings, 0 replies; 5+ messages in thread
From: Ted Dennison @ 2001-01-11 18:13 UTC (permalink / raw)


In article <93j5d9$1gt$1@nnrp1.deja.com>,
  Robert Dewar <robert_dewar@my-deja.com> wrote:

> Not at the moment, but when GNAT becomes part of the gcc tree,
> then presumably people will report bugs on the public version
> using the standard gcc bug reporting mechanisms -- that's the
> idea anyway -- we will see how it works out.

Ahh. You mean we'll be reporting Gnat bugs using Gnats? %-)

--
T.E.D.

http://www.telepath.com/~dennison/Ted/TED.html


Sent via Deja.com
http://www.deja.com/



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-01-11 18:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-10  2:32 volatile with gnat Wayne Bullaughey
2001-01-10 22:00 ` Robert Dewar
2001-01-11  0:59   ` wayne
2001-01-11  2:22     ` Robert Dewar
2001-01-11 18:13       ` Ted Dennison

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