This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/20192] New: Unnecessary jump from &&
- From: "falk at debian dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Feb 2005 15:04:28 -0000
- Subject: [Bug tree-optimization/20192] New: Unnecessary jump from &&
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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/cset@1.2035.15.4?nav=index.html|ChangeSet@-2w).
--
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