This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
missed PTA optimization?
- From: "Uecker, Martin" <Martin dot Uecker at med dot uni-goettingen dot de>
- To: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Cc: "richard dot guenther at gmail dot com" <richard dot guenther at gmail dot com>
- Date: Tue, 11 Feb 2020 20:32:14 +0000
- Subject: missed PTA optimization?
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