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 tree-optimization/19940] New: Missed jump threading opportunity due to |.


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


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