https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120747
Bug ID: 120747 Summary: [16 Regression] 435.gromacs miscompares since r16-1550-g9244ea4bf55638 Product: gcc Version: 16.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: pheeck at gcc dot gnu.org CC: amacleod at redhat dot com Blocks: 26163 Target Milestone: --- Host: x86_64-pc-linux-gnu Target: x86_64-pc-linux-gnu Running 435.gromacs SPEC CPU 2006 benchmark on a Zen4 or Zen5 machine with -Ofast -march=native currently results in a miscompare. 0002: 3.07684e+02 3.12012e+02 ^ The benchmark allows some variations but this difference is bigger than it allows (~1.31% vs 1.25%). I've bisected this to 9244ea4bf556381d3f7fb66154dc8944ebeb005c is the first bad commit commit 9244ea4bf556381d3f7fb66154dc8944ebeb005c Author: Andrew MacLeod <amacl...@redhat.com> Date: Mon Jun 16 15:41:47 2025 -0400 Snap subrange boundries to bitmask constraints. Ensure all subrange endpoints conform to the bitmask. PR tree-optimization/120661 gcc/ * value-range.cc (irange::snap): New. (irange::snap_subranges): New. (irange::set_range_from_bitmask): Call snap_subranges. * value-range.h (snap, snap_subranges): New prototypes. gcc/testsuite/ * gcc.dg/pr120661-1.c: New. * gcc.dg/pr120661-2.c: New. gcc/testsuite/gcc.dg/pr120661-1.c | 51 ++++++++++++++++++++++ gcc/testsuite/gcc.dg/pr120661-2.c | 39 +++++++++++++++++ gcc/value-range.cc | 91 +++++++++++++++++++++++++++++++++++++++ gcc/value-range.h | 2 + 4 files changed, 183 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/pr120661-1.c create mode 100644 gcc/testsuite/gcc.dg/pr120661-2.c Cc-ing Andrew. Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26163 [Bug 26163] [meta-bug] missed optimization in SPEC (2k17, 2k and 2k6 and 95)