This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/38826] points-to result wrong for reads from call-clobbered vars
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Jan 2009 12:34:54 -0000
- Subject: [Bug tree-optimization/38826] points-to result wrong for reads from call-clobbered vars
- References: <bug-38826-10053@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from rguenth at gcc dot gnu dot org 2009-01-13 12:34 -------
It is interesting to see how taking the address of &s.q makes it a pointer
variable. The fundamental issue seems to be that eliminating non-pointers
and their edges conflicts with field-sensitive analysis.
Consider
struct S { int *p; int *q; };
void foo (struct S **);
int *bar (int b)
{
struct S s;
struct S *p = &s;
foo (&p);
return s.q;
}
to see that just generating extra ADDRESSOF constraints for call arguments
will not fix the issue.
Not only we will need to avoid eliminating non-pointers / edges if any of a
variables sub-field has got a proper pointer label, unifying them (they
still have pointer label 0) is also wrong.
Danny, any idea where/how to fix this?
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dberlin at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38826