public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/38826]  New: points-to result wrong for reads from call-clobbered vars
@ 2009-01-13 12:14 rguenth at gcc dot gnu dot org
  2009-01-13 12:35 ` [Bug tree-optimization/38826] " rguenth at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-01-13 12:14 UTC (permalink / raw)
  To: gcc-bugs

The following testcase emits a strict-aliasing warning because the points-to
result for p is wrong.  It should be pt_anything, but instead the read from
s.q is considered a non-pointer variable (we do not have constraints for all
implicitly taken addresses by passing &s to the function call).

struct S { int *p; int *q; };

void foo (struct S *);

int bar (int b)
{
  struct S s;
  int *p;
  float f;
  foo (&s);
  if (b)
    p = s.q;
  else
    p = (int *)&f;
  return *p;
}

Inspecting the points-to results on

struct S { int *p; int *q; };

void foo (struct S *);

int *bar (int b)
{
  struct S s;
  foo (&s);
  return s.q;
}

exposes the failure as

ESCAPED = { ESCAPED NONLOCAL s s.64+64 }
...
s = { ESCAPED NONLOCAL }
s.64+64 = { ESCAPED NONLOCAL }
D.1598_1 = { }


D.1598_1 should have the same solution as s.64+64.


-- 
           Summary: points-to result wrong for reads from call-clobbered
                    vars
           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=38826


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-01-14 16:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-13 12:14 [Bug tree-optimization/38826] New: points-to result wrong for reads from call-clobbered vars rguenth at gcc dot gnu dot org
2009-01-13 12:35 ` [Bug tree-optimization/38826] " rguenth at gcc dot gnu dot org
2009-01-13 14:37 ` rguenth at gcc dot gnu dot org
2009-01-13 18:43 ` dberlin at dberlin dot org
2009-01-14 16:46 ` rguenth at gcc dot gnu dot org
2009-01-14 16:46 ` rguenth at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).