This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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]

-fargument-noalias-global question


Actually I have two questions.  First, what is the difference between
-fargument-noalias-global and -fargument-noalias-anything (please
provide an example, not cite documentation ;))

Second question.  Does "global memory" include memory that escaped?
Thus, with -fargument-noalias-global:

int *p;
void foo(int *q)
{
  may *q and *p alias?
}

consider

void bar()
{
  int i;
  p = &i;
  foo (&i);
}

does that call to foo invoke undefined behavior if built with
-fargument-noalias-global?  Is _that_ the difference vs.
-fargument-noalias-anything (-global would not alias global
decls, -anything would not alias any reachable memory (other than
what the parameter reaches?  or just what it points to?)).

Thanks for clarifications.
Richard.


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