pro64-support
[Top] [All Lists]

Re: sgicc and -fvolatile

To: Michael Murphy <mpm@xxxxxxxxxxxxxxxxx>
Subject: Re: sgicc and -fvolatile
From: Sterling Augustine <Sterling@xxxxxxxxxxxxx>
Date: Tue, 17 Apr 2001 08:18:24 -0700
Cc: pro64-support@xxxxxxxxxxx
References: <200104170040.RAA68336@rohi.engr.sgi.com>
Sender: owner-pro64-support@xxxxxxxxxxx
It is supposed to force all memory accesses through pointers to be
treated as volatile.

Here is a simple testcase:

int foo;

int main()
{
  int * foo_p = &foo;

  * foo_p = 1;
  * foo_p = 2;
}

if you compile the above with egcs 2.95.2 at -O3, the first indirection
off foo_p is optimized away. But if you compile the above at -03 and
-fvolatile, then it remains.

sgicc -O3 -v -Wf,-fvolatile -S

will force -fvolatile to be passed to the front end, but (as unfamiliar
as I am with IA64 assembly), it still looks to me like the first line is
optimized away. So -fvolatile doesn't appear to work, and should
probably result in an unsupported warning.

Sterling






Michael Murphy wrote:
> 
>         From: Sterling Augustine <Sterling@xxxxxxxxxxxxx>
> 
>         Although sgicc accepts -fvolatile, it does not pass it to the front or
>         back ends (diffing the verbose output with and without the option
>         reveals no differences.) Is there a reason for that? Do the front ends
>         actually support -fvolatile, but there is a bug in the driver, or 
> should
>         the driver be warning about an option that has no effect? (Or does
>         anyone actually know what should be happening?)
> 
> The driver does not pass it to the phases.
> It could pass it to the front end, but that doesn't seem
> to have any effect.  Actually, even gcc seems to ignore -fvolatile
> and -fvolatile-global when I try them, but maybe I'm using it wrong?
> -- Mike Murphy
> -- mpm@xxxxxxx
> -- quote of the day:
> --  "A man's pride will bring him low, but the humble in spirit
> --   will retain honor."  (Proverbs 29:23)

<Prev in Thread] Current Thread [Next in Thread>