int i;
int foo (int *p, int b)
{
if (b)
p = &i;
i = 1;
*p = 0;
return i;
}
at -O2 -fargument-noalias-global shows
# p_1 = PHI <p_3(D)(2), &i(3)>
# i_7 = VDEF <i_6(D)>
i = 1;
# PARM_NOALIAS.10_9 = VDEF <PARM_NOALIAS.10_8(D)>
*p_1 = 0;
# VUSE <i_7>
D.1596_5 = i;
even though *p_1 aliases i.
--
Summary: PTA TBAA pruning wrong for -fargument-noalias-*
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rguenth at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39506