This function:

#define PMD_MASK    (~((1UL << 23) - 1))
void clear_pmd_range(unsigned long start, unsigned long end) 
{ 
    if (!(start & ~PMD_MASK) && !(end & ~PMD_MASK)) 
        f(); 
} 

should be optimized to generate the same code as this function:
 
void clear_pmd_range2(unsigned long start, unsigned long end) 
{ 
    if (!((start | end) & ~PMD_MASK)) 
        f(); 
} 

that is, use only one conditional branch (see also
http://linux.bkbits.net:8080/linux-2.5/[EMAIL PROTECTED]|[EMAIL PROTECTED]).

-- 
           Summary: Unnecessary jump from &&
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: falk at debian dot org
                CC: gcc-bugs at gcc dot gnu dot org


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

Reply via email to