comp.lang.ada
 help / color / mirror / Atom feed
From: Samuel Tardieu <sam@rfc1149.net>
Subject: Re: Access to fixed memory location
Date: Fri, 30 Nov 2007 22:42:09 +0100
Date: 2007-11-30T22:45:01+01:00	[thread overview]
Message-ID: <87wsrz1kcu.fsf@willow.rfc1149.net> (raw)
In-Reply-To: 4750654d$0$13115$9b4e6d93@newsspool2.arcor-online.net

>>>>> "Tomas" == Tomas Cernaj <tcernaj.WITHOUTTHIS@gmx.de> writes:

Tomas> That's because the compiler can not assume that Y'Address will
Tomas> not be changed.

Well, no, that's not the reason (Y'Address is obviously static and
constant). This is due to an unfortunate combination of three things:

 a) because of RM13.3(19), no optimization can be done on Y based on
    assumptions of no aliases

 b) to implement this clause, GCC marks the implicitly defined pointer
    type as volatile

 c) when this implicitly defined pointer type is marked as volatile,
    GCC generates code which does read+modify+write here at 3 separate
    operations rather than using an atomic one

I think GNAT is overconservative concerning (b) as I do not think a
volatile behaviour is mandated here, and that (c) could generate a
better code but this is a separate issue from (b).

  Sam
-- 
Samuel Tardieu -- sam@rfc1149.net -- http://www.rfc1149.net/



  reply	other threads:[~2007-11-30 21:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-30 19:32 Access to fixed memory location Tomas Cernaj
2007-11-30 21:42 ` Samuel Tardieu [this message]
2007-11-30 22:22   ` Samuel Tardieu
2007-12-02 22:00   ` Tomas Cernaj
2007-12-02 23:13     ` Samuel Tardieu
replies disabled

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