This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug optimization/13875] [tree-ssa] missed jump thread optimization on the tree-level


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]