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

            Bug ID: 106243
           Summary: Failure to optimize (0 - x) & 1 on vector type
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gabravier at gmail dot com
  Target Milestone: ---

#include <stdint.h>

typedef int64_t v2i64 __attribute__((vector_size(16)));

v2i64 f(v2i64 x)
{
    return (0 - x) & 1;
}

This can be optimized to `return x & 1;`. LLVM does this transformation, but
GCC does not

Reply via email to