This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/20115] New: [4.0 Regression] Pure functions are missed handled
- 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: 20 Feb 2005 23:06:56 -0000
- Subject: [Bug tree-optimization/20115] New: [4.0 Regression] Pure functions are missed handled
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Take the following code, we should not abort:
int func_pure (void);
void func_other (int);
int global_int;
int func_pure (void) { return global_int; }
void func_other (int a)
{
global_int = a + 1;
}
int f(void)
{
int a;
a = func_pure();
func_other (a);
a = func_pure (); // We are removing this function call
return a;
}
void abort (void);
int main(void)
{
global_int = 10;
if (f() != 11)
abort ();
}
--
Summary: [4.0 Regression] Pure functions are missed handled
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P2
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20115