pro64-support
[Top] [All Lists]

Re: sgicc and -fvolatile

To: Michael Murphy <mpm@xxxxxxxxxxxxxxxxx>
Subject: Re: sgicc and -fvolatile
From: Jim Kingdon <jkingdon@xxxxxxxxxxxxxxxxxxxx>
Date: Tue, 17 Apr 2001 14:10:10 -0700
Cc: Sterling Augustine <Sterling@xxxxxxxxxxxxx>, pro64-support@xxxxxxxxxxx
References: <200104170040.RAA68336@xxxxxxxxxxxxxxxxx> <200104171900.MAA77267@xxxxxxxxxxxxxxxxx>
Sender: owner-pro64-support@xxxxxxxxxxx
Michael Murphy wrote:
>         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.

I tried this test case with a couple ia64 GCC's (2.96-ish and 3.1-ish)
and
-fvolatile had no effect.  I was using -O2 in all my tests.

Then I tried it on MIPS.  GCC 2.95 (from freeware.sgi.com) worked right
(-fvolatile made both stores appear).  But GCC 2.97 which I built myself
had the bug.  So this appears to have bitrotted; see http://gcc.gnu.org/
for reporting bugs.

> Once gcc supports this, passing -fvolatile to the
> sgicc front end may still not do anything, depending on how gcc
> implements this.  It might require back-end work.

Hmm, not sure.  I suspect the front-end might require work too
(haven't looked too closely).

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