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

Luke Robison 2101084 at bugs.launchpad.net
Mon Mar 24 21:04:21 UTC 2025


To clarify: this bug affects GCC8 and up with the following flags:

CFLAGS="-O3 -march=armv8.1-a+sve"

Test case can be found here: https://godbolt.org/z/4E51ETMfa or in the
GCC ticket.

To confirm the fix use Graviton4 (or another 128-bit SVE vector CPU).

The test will either print:
    PASS: got 0x00bbbbbb 0x00aaaaaa as expected
or
    ERROR: expected 0x00bbbbbb 0x00aaaaaa but got 0x00bbbbbb 0xaaaaaaaa

GCC has fixed it in the branches for gcc-12 and up, and those fixes will
be in the next GCC release, but since LTS 2004 uses gcc-9 and LTS 2204
uses gcc-11, fixes to those versions will need to be manually backported
by Canonical or risk emitting incorrect code.

-- 
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 gcc-10 package in Ubuntu:
  New
Status in gcc-11 package in Ubuntu:
  New
Status in gcc-8 package in Ubuntu:
  New
Status in gcc-9 package in Ubuntu:
  New

Bug description:
  This bug-report is to request patching of the GCC bug 118976 in the
  Ubuntu gcc packages to avoid correctness issues, especially in 24.04
  and 22.04 LTS releases.

  This issue effects SVE vectorization which involves bitwise-not during
  optimization on arm64 platforms.  It was reported and fixed in
  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118976.

  For gcc 8-11 there will be no minor releases as they are EOL from GCC
  team.  For gcc 11 through trunk the fix will be included in the next
  minor version, but my understanding is that Ubuntu LTS releases are
  unlikely to upgrade minor versions.

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




More information about the foundations-bugs mailing list