This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/25558] New: Arguments cannot alias local variables
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Dec 2005 04:12:58 -0000
- Subject: [Bug tree-optimization/25558] New: Arguments cannot alias local variables
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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