public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/25558]  New: Arguments cannot alias local variables
@ 2005-12-25  4:13 pinskia at gcc dot gnu dot org
  2005-12-25  4:16 ` [Bug tree-optimization/25558] " pinskia at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-12-25  4:13 UTC (permalink / raw)
  To: gcc-bugs

I cannot remember if I filed a bug about this or not but I noticed this while
looking at some Fortran code.  Here is testcase which shows the issue:
void link_error(void);

int *t;
int g(int *a)
{
  t = a;
  *a = 2;
}

void f(int *a)
{
  int b;
  b = 1;
  g(&b);
  b = 2;
  *a = 1;  <--- a cannot point to b here.
  if (b == 2)
    link_error();
}

int main(void)
{
  int t;
  f(&t);
  return 0;
}


-- 
           Summary: Arguments cannot alias local variables
           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=25558


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

end of thread, other threads:[~2006-01-11  1:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-25  4:13 [Bug tree-optimization/25558] New: Arguments cannot alias local variables pinskia at gcc dot gnu dot org
2005-12-25  4:16 ` [Bug tree-optimization/25558] " pinskia at gcc dot gnu dot org
2005-12-25  4:19 ` pinskia at gcc dot gnu dot org
2005-12-25  4:20 ` pinskia at gcc dot gnu dot org
2005-12-25  4:56 ` pinskia at gcc dot gnu dot org
2005-12-25  5:05 ` pinskia at gcc dot gnu dot org
2005-12-25  5:30 ` pinskia at gcc dot gnu dot org
2006-01-11  1:07 ` pinskia 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).