missed PTA optimization?

Uecker, Martin Martin.Uecker@med.uni-goettingen.de
Tue Feb 11 20:32:00 GMT 2020


In the following example, it seems
that 'bar' could be optimized to
return '1' and every else could be
optimized away. Or am I missing
something?   Do I need to add
some specific compiler flags?



static int a = 1;
static int *p;

extern
void foo(void)
{
  p = &a;
}

extern
int bar(void)
{
  return *p;
}


thank you,
Martin


More information about the Gcc mailing list