Skip to content

Fix GCC 15 -Werror build warnings#29679

Open
mirounga wants to merge 1 commit into
microsoft:mainfrom
mirounga:rs_buf7
Open

Fix GCC 15 -Werror build warnings#29679
mirounga wants to merge 1 commit into
microsoft:mainfrom
mirounga:rs_buf7

Conversation

@mirounga

Copy link
Copy Markdown

Description

  • skip_layer_norm_fusion.cc: make the FindPath matcher paths function-local static const std::vector (they are compile-time constants). Built once instead of per node iteration, and the destructors run at exit rather than inlined into ApplyImpl, sidestepping a -Wfree-nonheap-object false positive.
  • test/unittest_util/conversion.h: convert the float<->half / int cast helpers from Eigen Map cast-assignments to std::transform. The Eigen path vectorizes to _mm512_loadu_ps, which GCC 15 mis-flags with -Warray-bounds when inlined into callers passing small fixed-size buffers. Semantics are unchanged.
  • zipmap_test.cc: take std::initializer_list and materialize the class-list vector inside TestHelper, keeping the vector out of the inlined TEST body where GCC 15 emits a -Wfree-nonheap-object false positive.

Motivation and Context

GCC 15 with -march=native emits several false-positive warnings that fail the -Werror build. Fixed the underlying code so the warnings no longer fire, with no functional change:

GCC 15 with -march=native emits several false-positive warnings that fail
the -Werror build. Fixed the underlying code so the warnings no longer fire,
with no functional change:

- skip_layer_norm_fusion.cc: make the FindPath matcher paths function-local
  `static const std::vector` (they are compile-time constants). Built once
  instead of per node iteration, and the destructors run at exit rather than
  inlined into ApplyImpl, sidestepping a -Wfree-nonheap-object false positive.
- test/unittest_util/conversion.h: convert the float<->half / int cast helpers
  from Eigen Map cast-assignments to std::transform. The Eigen path vectorizes
  to _mm512_loadu_ps, which GCC 15 mis-flags with -Warray-bounds when inlined
  into callers passing small fixed-size buffers. Semantics are unchanged.
- zipmap_test.cc: take std::initializer_list<T> and materialize the class-list
  vector inside TestHelper, keeping the vector out of the inlined TEST body where
  GCC 15 emits a -Wfree-nonheap-object false positive.
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@mirounga

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree company="Microsoft"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant