This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFH: Impose code-movement restrictions and value assumption (for ASYNCHRONOUS/Coarrays)


Hello,

On Wednesday 13 July 2011 15:46:37 Tobias Burnus wrote:
> 
> void some_function(void);
> 
> void
> sub (int *restrict non_aliasing_var)
> {
>    *non_aliasing_var = 5;
>    some_function ();
>    if (*non_aliasing_var != 5)
>      foobar_();
> }
> 

Couldn't we simulate the desired behaviour with more than one decl, one of 
them const qualified? Like so:

void
sub (int *restrict non_aliasing_var)
{
   *non_aliasing_var = 5;
   {
      const int *non_aliasing_var_tmp = non_aliasing_var;
      some_function ();
      if (*non_aliasing_var_tmp != 5)
         foobar_();
   }
}


It would probably be a hell to implement however.

Mikael


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]