Skip to content

Fix GCC optimization guards for Clang - #241

Open
ricardoasouz wants to merge 1 commit into
ARM-software:mainfrom
ricardoasouz:fix/clang-gcc-optimization-guards
Open

Fix GCC optimization guards for Clang#241
ricardoasouz wants to merge 1 commit into
ARM-software:mainfrom
ricardoasouz:fix/clang-gcc-optimization-guards

Conversation

@ricardoasouz

Copy link
Copy Markdown

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.

Signed-off-by: Ricardo Alves de Souza <ricardoasouz@hotmail.com>
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

1 participant