This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/19827] New: Missed pure/const optimization
- 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: 8 Feb 2005 18:31:22 -0000
- Subject: [Bug tree-optimization/19827] New: Missed pure/const optimization
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following two function should produce the same asm because we can skip the second call to f:
int f(void) __attribute__((const,pure));
int g(int i, int j)
{
int k = 0;
if(i)
k = f();
if (j)
k = f();
return k;
}
int h(int i, int j)
{
int k = 0;
if(i)
k = f();
else if (j)
k = f();
return k;
}
--
Summary: Missed pure/const optimization
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: enhancement
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=19827