This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/12187] New: Miscompilation of nested functions using host variables
- From: "pbrook at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Sep 2003 22:34:16 -0000
- Subject: [Bug optimization/12187] New: Miscompilation of nested functions using host variables
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12187
Summary: Miscompilation of nested functions using host variables
Product: gcc
Version: tree-ssa
Status: UNCONFIRMED
Keywords: wrong-code
Severity: critical
Priority: P2
Component: optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pbrook at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
Functions containing nested functions which write to variables in their parent
are miscompiled. This might be rare in C, but is quite common in Fortran.
Simple Testcase
int main()
{
int a;
void test(int i)
{
a = i;
};
a = 0;
test (42);
if (a != 42)
abort ();
exit (0);
}