This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
-fargument-noalias-global question
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc at gcc dot gnu dot org
- Date: Sat, 3 Jan 2009 15:44:24 +0100 (CET)
- Subject: -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.