This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: RFH: Impose code-movement restrictions and value assumption (for ASYNCHRONOUS/Coarrays)
- From: Mikael Morin <mikael dot morin at sfr dot fr>
- To: fortran at gcc dot gnu dot org
- Cc: Tobias Burnus <burnus at net-b dot de>, Ian Lance Taylor <iant at google dot com>, GCC Mailing List <gcc at gcc dot gnu dot org>
- Date: Thu, 14 Jul 2011 20:35:55 +0200
- Subject: Re: RFH: Impose code-movement restrictions and value assumption (for ASYNCHRONOUS/Coarrays)
- References: <4E1D73DE.3090609@net-b.de> <mcrsjqaia44.fsf@coign.corp.google.com> <4E1DA1BD.6000801@net-b.de>
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