* egcs 1.1b and "volatile"
@ 1998-10-28 20:18 erik.ivanenko
1998-10-29 9:46 ` Jeffrey A Law
0 siblings, 1 reply; 3+ messages in thread
From: erik.ivanenko @ 1998-10-28 20:18 UTC (permalink / raw)
To: rtems-snapshots, egcs
Is there some way to guarantee that a volatile variable will remain
volatile regardless of optimization level? This is critical when
writing a device driver that modifies CPU memory. eg. i82596.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: egcs 1.1b and "volatile"
1998-10-28 20:18 egcs 1.1b and "volatile" erik.ivanenko
@ 1998-10-29 9:46 ` Jeffrey A Law
0 siblings, 0 replies; 3+ messages in thread
From: Jeffrey A Law @ 1998-10-29 9:46 UTC (permalink / raw)
To: erik.ivanenko; +Cc: rtems-snapshots, egcs
In message < 3637A2D7.3B01A550@utoronto.ca >you write:
> This is a multi-part message in MIME format.
> --------------CDDA1730C8C094789C88A68C
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
>
> Is there some way to guarantee that a volatile variable will remain
> volatile regardless of optimization level? This is critical when
> writing a device driver that modifies CPU memory. eg. i82596.
A load to or store from a volatile variable can never be deleted regardless
of the optimization level.
jeff
^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <199810290344.VAA05838@shaw.wave.ca>]
* Re: egcs 1.1b and "volatile"
[not found] <199810290344.VAA05838@shaw.wave.ca>
@ 1998-10-30 2:40 ` erik.ivanenko
0 siblings, 0 replies; 3+ messages in thread
From: erik.ivanenko @ 1998-10-30 2:40 UTC (permalink / raw)
To: rtems-snapshots, egcs
Eric Norum wrote:
> erik.ivanenko@utoronto.ca wrote:
>
> >Is there some way to guarantee that a volatile variable will remain
> >volatile regardless of optimization level? This is critical when
> >writing a device driver that modifies CPU memory. eg. i82596.
>
> The volatile keyword tells the optimizer that the value of the variable in
> question may change in ways that can not be inferred from the C statements.
>
While I was composing my response, ( which included code references ) I
noticed that I had placed the volatile qualifier on only one of two required
places. Sorry for the confusion.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1998-10-30 2:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-10-28 20:18 egcs 1.1b and "volatile" erik.ivanenko
1998-10-29 9:46 ` Jeffrey A Law
[not found] <199810290344.VAA05838@shaw.wave.ca>
1998-10-30 2:40 ` erik.ivanenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).