From 877ac81181e93a61dc0f1d5fd02dbf7e4cf6fa4f Mon Sep 17 00:00:00 2001 From: Petter Reinholdtsen <pere@debian.org> Date: Fri, 7 Mar 2025 14:48:34 +0100 Subject: [PATCH] Adjusted macros to avoid working outside OC_IDCT_CONSTS array. The OC_IDCT_CONSTS array in x86/sse2idct.c is 64 elements long, so not use trying to pretend it is 128 elements long. This avoid the following copmiler message: In function 'oc_idct8x8_slow_mmx', inlined from 'oc_idct8x8_mmx' at ../../lib/x86/mmxidct.c:555:8: ../../lib/x86/mmxidct.c:290:3: warning: array subscript 'const struct <anonymous>[0]' is partly outside array bounds of 'const short unsigned int[64]' [-Warray-bounds] 290 | __asm__ __volatile__( | ^~~~~~~ In file included from ../../lib/x86/mmxidct.c:20: ../../lib/x86/x86int.h: In function 'oc_idct8x8_mmx': ../../lib/x86/x86int.h:95:58: note: object 'OC_IDCT_CONSTS' of size 128 95 | extern const unsigned short __attribute__((aligned(16))) OC_IDCT_CONSTS[64]; | ^~~~~~~~~~~~~~ In function 'oc_idct8x8_10_mmx', inlined from 'oc_idct8x8_mmx' at ../../lib/x86/mmxidct.c:554:20: ../../lib/x86/mmxidct.c:492:3: warning: array subscript 'const struct <anonymous>[0]' is partly outside array bounds of 'const short unsigned int[64]' [-Warray-bounds] 492 | __asm__ __volatile__( | ^~~~~~~ ../../lib/x86/x86int.h: In function 'oc_idct8x8_mmx': ../../lib/x86/x86int.h:95:58: note: object 'OC_IDCT_CONSTS' of size 128 95 | extern const unsigned short __attribute__((aligned(16))) OC_IDCT_CONSTS[64]; | ^~~~~~~~~~~~~~ CC x86/sse2idct.lo In function 'oc_idct8x8_slow_sse2', inlined from 'oc_idct8x8_sse2' at ../../lib/x86/sse2idct.c:453:8: ../../lib/x86/sse2idct.c:213:3: warning: array subscript 'const struct <anonymous>[0]' is partly outside array bounds of 'const short unsigned int[64]' [-Warray-bounds] 213 | __asm__ __volatile__( | ^~~~~~~ ../../lib/x86/sse2idct.c: In function 'oc_idct8x8_sse2': ../../lib/x86/sse2idct.c:26:56: note: object 'OC_IDCT_CONSTS' of size 128 26 | const unsigned short __attribute__((aligned(16),used)) OC_IDCT_CONSTS[64]={ | ^~~~~~~~~~~~~~ In function 'oc_idct8x8_10_sse2', inlined from 'oc_idct8x8_sse2' at ../../lib/x86/sse2idct.c:452:20: ../../lib/x86/sse2idct.c:398:3: warning: array subscript 'const struct <anonymous>[0]' is partly outside array bounds of 'const short unsigned int[64]' [-Warray-bounds] 398 | __asm__ __volatile__( | ^~~~~~~ ../../lib/x86/sse2idct.c: In function 'oc_idct8x8_sse2': ../../lib/x86/sse2idct.c:26:56: note: object 'OC_IDCT_CONSTS' of size 128 26 | const unsigned short __attribute__((aligned(16),used)) OC_IDCT_CONSTS[64]={ | ^~~~~~~~~~~~~~ --- lib/x86/mmxidct.c | 4 ++-- lib/x86/sse2idct.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/x86/mmxidct.c b/lib/x86/mmxidct.c index b8e30770..5fceb246 100644 --- a/lib/x86/mmxidct.c +++ b/lib/x86/mmxidct.c @@ -312,7 +312,7 @@ static void oc_idct8x8_slow_mmx(ogg_int16_t _y[64],ogg_int16_t _x[64]){ #undef OC_J :[y]"=m"OC_ARRAY_OPERAND(ogg_int16_t,_y,64) :[x]"m"OC_CONST_ARRAY_OPERAND(ogg_int16_t,_x,64), - [c]"m"OC_CONST_ARRAY_OPERAND(ogg_int16_t,OC_IDCT_CONSTS,128) + [c]"m"OC_CONST_ARRAY_OPERAND(ogg_int16_t,OC_IDCT_CONSTS,64) ); __asm__ __volatile__("pxor %%mm0,%%mm0\n\t"::); for(i=0;i<4;i++){ @@ -510,7 +510,7 @@ static void oc_idct8x8_10_mmx(ogg_int16_t _y[64],ogg_int16_t _x[64]){ #undef OC_J :[y]"=m"OC_ARRAY_OPERAND(ogg_int16_t,_y,64) :[x]"m"OC_CONST_ARRAY_OPERAND(ogg_int16_t,_x,64), - [c]"m"OC_CONST_ARRAY_OPERAND(ogg_int16_t,OC_IDCT_CONSTS,128) + [c]"m"OC_CONST_ARRAY_OPERAND(ogg_int16_t,OC_IDCT_CONSTS,64) ); __asm__ __volatile__( "pxor %%mm0,%%mm0\n\t" diff --git a/lib/x86/sse2idct.c b/lib/x86/sse2idct.c index 4597ab07..874f0ad3 100644 --- a/lib/x86/sse2idct.c +++ b/lib/x86/sse2idct.c @@ -229,7 +229,7 @@ static void oc_idct8x8_slow_sse2(ogg_int16_t _y[64],ogg_int16_t _x[64]){ :[buf]"=m"(OC_ARRAY_OPERAND(ogg_int16_t,buf,16)), [y]"=m"(OC_ARRAY_OPERAND(ogg_int16_t,_y,64)) :[x]"m"(OC_CONST_ARRAY_OPERAND(ogg_int16_t,_x,64)), - [c]"m"(OC_CONST_ARRAY_OPERAND(ogg_int16_t,OC_IDCT_CONSTS,128)) + [c]"m"(OC_CONST_ARRAY_OPERAND(ogg_int16_t,OC_IDCT_CONSTS,64)) ); __asm__ __volatile__("pxor %%xmm0,%%xmm0\n\t"::); /*Clear input data for next block (decoder only).*/ @@ -407,7 +407,7 @@ static void oc_idct8x8_10_sse2(ogg_int16_t _y[64],ogg_int16_t _x[64]){ :[buf]"=m"(OC_ARRAY_OPERAND(short,buf,16)), [y]"=m"(OC_ARRAY_OPERAND(ogg_int16_t,_y,64)) :[x]"m"OC_CONST_ARRAY_OPERAND(ogg_int16_t,_x,64), - [c]"m"(OC_CONST_ARRAY_OPERAND(ogg_int16_t,OC_IDCT_CONSTS,128)) + [c]"m"(OC_CONST_ARRAY_OPERAND(ogg_int16_t,OC_IDCT_CONSTS,64)) ); /*Clear input data for next block (decoder only).*/ __asm__ __volatile__( -- GitLab