[Bug 2101084] Re: GCC produces wrong code for arm64+sve in some cases

gerald.yang 2101084 at bugs.launchpad.net
Thu Aug 21 08:20:18 UTC 2025


** Changed in: gcc-11 (Ubuntu Jammy)
     Assignee: Chengen Du (chengendu) => gerald.yang (gerald-yang-tw)

** Changed in: gcc-13 (Ubuntu Noble)
     Assignee: Chengen Du (chengendu) => gerald.yang (gerald-yang-tw)

** Changed in: ubuntu-pro/20.04
     Assignee: (unassigned) => gerald.yang (gerald-yang-tw)

** Changed in: gcc-11 (Ubuntu Jammy)
       Status: New => In Progress

** Changed in: ubuntu-pro/20.04
       Status: New => In Progress

** Changed in: gcc-13 (Ubuntu Noble)
       Status: New => In Progress

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gcc-10 in Ubuntu.
https://bugs.launchpad.net/bugs/2101084

Title:
  GCC produces wrong code for arm64+sve in some cases

Status in gcc:
  Fix Released
Status in Ubuntu Pro:
  In Progress
Status in Ubuntu Pro 20.04 series:
  In Progress
Status in gcc-10 package in Ubuntu:
  New
Status in gcc-11 package in Ubuntu:
  New
Status in gcc-13 package in Ubuntu:
  New
Status in gcc-14 package in Ubuntu:
  New
Status in gcc-8 package in Ubuntu:
  Won't Fix
Status in gcc-9 package in Ubuntu:
  New
Status in gcc-10 source package in Focal:
  Won't Fix
Status in gcc-8 source package in Focal:
  Won't Fix
Status in gcc-9 source package in Focal:
  Won't Fix
Status in gcc-10 source package in Jammy:
  New
Status in gcc-11 source package in Jammy:
  In Progress
Status in gcc-9 source package in Jammy:
  New
Status in gcc-10 source package in Noble:
  New
Status in gcc-11 source package in Noble:
  New
Status in gcc-13 source package in Noble:
  In Progress
Status in gcc-14 source package in Noble:
  New
Status in gcc-9 source package in Noble:
  New
Status in gcc-11 source package in Oracular:
  Won't Fix
Status in gcc-13 source package in Oracular:
  Won't Fix
Status in gcc-14 source package in Oracular:
  Won't Fix
Status in gcc-11 source package in Plucky:
  New
Status in gcc-13 source package in Plucky:
  Won't Fix
Status in gcc-14 source package in Plucky:
  Won't Fix
Status in gcc-11 source package in Questing:
  New
Status in gcc-13 source package in Questing:
  Won't Fix
Status in gcc-14 source package in Questing:
  Won't Fix

Bug description:
  [Impact]
  This issue affects SVE vectorization on arm64 platforms, specifically in cases where bitwise-not operations are applied during optimization.

  [Fix]
  This issue has been resolved by an upstream patch.

  commit 78380fd7f743e23dfdf013d68a2f0347e1511550
  Author: Richard Sandiford <richard.sandiford at arm.com>
  Date: Tue Mar 4 10:44:35 2025 +0000

      Fix folding of BIT_NOT_EXPR for POLY_INT_CST [PR118976]

      There was an embarrassing typo in the folding of BIT_NOT_EXPR for
      POLY_INT_CSTs: it used - rather than ~ on the poly_int.  Not sure
      how that happened, but it might have been due to the way that
      ~x is implemented as -1 - x internally.

      gcc/
              PR tree-optimization/118976
              * fold-const.cc (const_unop): Use ~ rather than - for BIT_NOT_EXPR.
              * config/aarch64/aarch64.cc (aarch64_test_sve_folding): New function.
              (aarch64_run_selftests): Run it.

  [Test Plan]
  1. Launch an instance using the latest generation of Graviton processors (Graviton4).
  2. Compile the code provided in the following link using the command `gcc -O3 -march=armv8.1-a+sve`
  https://godbolt.org/z/c99bMjene
  3. Verify that the execution output does not contain the string "ERROR".

  [Where problems could occur]
  The issue is caused by a typo. If any regressions occur, they are expected to impact only specific partial instructions under certain scenarios, rather than disrupting the overall functionality.

To manage notifications about this bug go to:
https://bugs.launchpad.net/gcc/+bug/2101084/+subscriptions




More information about the foundations-bugs mailing list