[Bug fortran/37780] New: Optimize LEADZ/TRAILZ for zero arguments

burnus at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Thu Oct 9 07:13:00 GMT 2008


Follow up to PR 37635.

>From trans-intrinsic.c:
/* LEADZ (i) = (i == 0) ? BIT_SIZE (i)
                        : __builtin_clz(i) - (BIT_SIZE('int') - BIT_SIZE(i))

   The conditional expression is necessary because the result of LEADZ(0)
   is defined, but the result of __builtin_clz(0) is undefined for most
   targets.
[...]
  /* ??? For some combinations of targets and integer kinds, the condition
         can be avoided if CLZ_DEFINED_VALUE_AT_ZERO is used.  Later.  */


-- 
           Summary: Optimize LEADZ/TRAILZ for zero arguments
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


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



More information about the Gcc-bugs mailing list