This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/18832] New: missed jump threading with ||
- 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: 4 Dec 2004 19:31:50 -0000
- Subject: [Bug tree-optimization/18832] New: missed jump threading with ||
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
I was messing around with trying to find compile time regressions.
The following 3 functions should produce the same asm.
int f0(int c, int a, int b)
{
if (a == 0 || b == 0) c++;
if (a == 0 || b == 0) c++;
return c;
}
int f1(int c,int a, int b)
{
if (a == 0) goto L1;
if (b == 0) goto L1; else goto L5;
L1:
c++;
L5:
if (a == 0) goto L2;
if (b == 0) goto L2; else goto L3;
L2:
c++;
L3:
return c;
}
int f2(int c,int a, int b)
{
if (a == 0) goto L1;
if (b == 0) goto L1; else goto L5;
L1:
c+=2;
L5:
return c;
}
--
Summary: missed jump threading with ||
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=18832