public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/26608]  New: address of local variables are said to escape even though it is obvious they don't
@ 2006-03-08 18:59 pinskia at gcc dot gnu dot org
  2006-03-08 19:44 ` Daniel Berlin
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-03-08 18:59 UTC (permalink / raw)
  To: gcc-bugs

Testcase:
int *d1;
int g(int *b)
{
  d1 = b;
}
int f(int a, int b, int c)
{
  int i, j;
  int *d;
  if (a)
    d = &i;
  else
    d = &j;
  i = 2;
  j = 3;
  g(&b);
  if (i!=2)
   link_error();
  if (j!=3)
   link_error();
  return *d;
}
int main(void)
{
  f(1, 2,3);
  return 0;
}

This should link with optimize but right now i and j are said to be call
clobbered for some reason.


-- 
           Summary: address of local variables are said to escape even
                    though it is obvious they don't
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: missed-optimization, alias
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26608


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

end of thread, other threads:[~2009-04-03 12:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-08 18:59 [Bug tree-optimization/26608] New: address of local variables are said to escape even though it is obvious they don't pinskia at gcc dot gnu dot org
2006-03-08 19:44 ` Daniel Berlin
2006-03-08 19:44 ` [Bug tree-optimization/26608] " dberlin at dberlin dot org
2006-03-08 19:47 ` pinskia at gcc dot gnu dot org
2006-09-12  6:37 ` pinskia at gcc dot gnu dot org
2009-04-03 12:24 ` 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).