[Bug tree-optimization/19940] New: Missed jump threading opportunity due to |.

kazu at cs dot umass dot edu gcc-bugzilla@gcc.gnu.org
Mon Feb 14 00:43:00 GMT 2005


Consider:

void bar (void);

int global;

void
foo (unsigned char pedwarned, unsigned char warned)
{
  unsigned char tem = warned | pedwarned;

  if (tem == 0)
    {
      if (global)
	warned = 1;
    }

  tem = warned | pedwarned;
  if (tem != 0)
    bar ();
}

Notice that if we get to "warned = 1;", we know we are going to call bar.
However, the tree optimizers do not notice this.

The RTL optimizers do find this optimization opportunity.

Reduced from c-decl.c:duplicate_decls.

-- 
           Summary: Missed jump threading opportunity due to |.
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: missed-optimization, TREE
          Severity: enhancement
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kazu at cs dot umass dot edu
                CC: gcc-bugs at gcc dot gnu dot org
OtherBugsDependingO 19794
             nThis:


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19940



More information about the Gcc-bugs mailing list