https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117045

            Bug ID: 117045
           Summary: Incorrect fold of SVE's svwhilele
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rsandifo at gcc dot gnu.org
  Target Milestone: ---
            Target: aarch64*-*-*

#include <arm_sve.h>
#include <limits.h>
svbool_t f() { return svwhilele_b8_s32(INT_MAX, INT_MAX); }

is folded to:

        ptrue p0.b, vl1
        ret

But this is incorrect.  Each increment of the first WHILELE operand is done in
32 bits (in this example) rather than to infinite precision.  The increment
therefore wraps and the result should be an all-true predicate instead.

Reply via email to