shared/runtime/gchelper_generic: Fix AArch32 build on Clang.

This commit fixes a compile error happening on Clang when building the
generic gchelper code for AArch32.

Clang would raise a warning regarding undefined variable access when
aliasing a variable to an existing CPU register.  The fix is pretty
crude but it works - it simply disables the warning in question for the
AArch32 gchelper collection function.  Care was taken to make sure the
code would also compile on GCC without warnings of sorts.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
This commit is contained in:
Alessandro Gatti
2024-11-18 22:00:31 +01:00
committed by Damien George
parent 0f7d68043f
commit 5784714f73

View File

@@ -101,6 +101,10 @@ static void gc_helper_get_regs(gc_helper_regs_t arr) {
// Fallback implementation, prefer gchelper_thumb1.s or gchelper_thumb2.s
static void gc_helper_get_regs(gc_helper_regs_t arr) {
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wuninitialized"
#endif
register long r4 asm ("r4");
register long r5 asm ("r5");
register long r6 asm ("r6");
@@ -121,6 +125,9 @@ static void gc_helper_get_regs(gc_helper_regs_t arr) {
arr[7] = r11;
arr[8] = r12;
arr[9] = r13;
#ifdef __clang__
#pragma clang diagnostic pop
#endif
}
#elif defined(__aarch64__)