This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/13875] [tree-ssa] missed jump thread optimization on the tree-level
- From: "dann at godzilla dot ics dot uci dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Mar 2004 23:47:02 -0000
- Subject: [Bug optimization/13875] [tree-ssa] missed jump thread optimization on the tree-level
- References: <20040127051055.13875.dann@godzilla.ics.uci.edu>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From dann at godzilla dot ics dot uci dot edu 2004-03-08 23:47 -------
Here's a simplified test derived from generate-3.4.ii that shows one more
optimization opportunity:
extern void foo1 (void);
extern void foo2 (void);
extern void foo3 (void);
extern void foo4 (void);
extern void foo5 (void);
extern void __assert (const char *, int, const char *);
void test (bool a, bool b, int c)
{
if ((a && b) || (!a && !b ))
{
if (c >= 2)
{
foo1 ();
if (a && b)
foo4 ();
else
foo5 ();
}
}
else
{
if (!a && b)
{
foo2 ();
}
else
{
((a && !b) ? (void)0 : __assert ("generate.C", 6154, "a && !b"));
foo3 ();
}
}
}
"if (a && b) foo4 (); else foo5 ();" can be simplified to
"if (a) foo4 (); else foo5 ();"
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13875