Skip to content

Fix GCC optimization guards for Clang - #241

Merged
mansnils merged 3 commits into
ARM-software:mainfrom
ricardoasouz:fix/clang-gcc-optimization-guards
Sep 22, 2026
Merged

mansnils merged 3 commits into
ARM-software:mainfrom
ricardoasouz:fix/clang-gcc-optimization-guards

Conversation

@ricardoasouz

Copy link
Copy Markdown
Contributor

Fixes #205

Clang defines __GNUC__ for GCC compatibility, but it does not support the GCC-specific optimize attribute and #pragma GCC optimize used in these code paths.

This change excludes Clang from the GCC-only optimization hints and also adds the missing IAR guard for arm_depthwise_conv_s8.c.

Validation:

  • Reproduced the Clang warnings for both the optimize attribute and #pragma GCC optimize.
  • Verified the guards remain enabled for GCC.
  • Verified the guards are disabled for Clang.
  • Completed the official CMSIS-NN Cortex-M33 GCC build successfully.

@ricardoasouz

Copy link
Copy Markdown
Contributor Author

Hi! Just checking in on this PR. It looks like the workflows are still awaiting maintainer approval. Please let me know if there’s anything I should update or provide from my side. Thanks!

@mansnils

Copy link
Copy Markdown
Contributor

Thank you @ricardoasouz !

@mansnils

Copy link
Copy Markdown
Contributor

Thanks for the PR. Could you update date and versions in the updated files?
It should be a minor update - See README.md's 'Version & Date' section and https://semver.org/.

@ricardoasouz
ricardoasouz force-pushed the fix/clang-gcc-optimization-guards branch from 6815908 to bab91d6 Compare September 22, 2026 11:13
@ricardoasouz

Copy link
Copy Markdown
Contributor Author

Thanks for the PR. Could you update date and versions in the updated files? It should be a minor update - See README.md's 'Version & Date' section and https://semver.org/.

Updated the date and minor versions in all three modified source files, and rebased onto the latest main. Thanks!

@mansnils
mansnils merged commit 71cbe3d into ARM-software:main Sep 22, 2026
11 checks passed
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.

GCC-specific optimization hints not guarded against Clang and partially not guarded against IAR, causing compiler warnings

2 participants