Skip to content

Commit e10a010

Browse files
Fix uninitialized variables in NEON FFT and matrix multiplication functions (#296)
Initialize the 'step' variable to 0 in both forward and backward FFT functions to prevent compiler warnings about potentially uninitialized variables. - arm_ne10_mixed_radix_fft_forward_float32_neon - arm_ne10_mixed_radix_fft_backward_float32_neon Initialize 'tw' to 'twiddles' at declaration in both forward and backward FFT macros to suppress -Wmaybe-uninitialized errors. Initialize 'temp' variable in arm_mat_mult_f64 NEON implementation to fix uninitialized variable warning when used in vsetq_lane_f64() calls. These changes fix compilation errors with GCC 14.3.0 which is stricter about detecting potentially uninitialized variables. Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
1 parent e249025 commit e10a010

4 files changed

Lines changed: 8 additions & 6 deletions

File tree

Ne10/NE10_fft_float32.neonintrinsic.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,7 +1214,7 @@ void arm_ne10_mixed_radix_fft_forward_float32_neon (
12141214
ne10_int32_t fstride = S->factors[1];
12151215
ne10_int32_t mstride = S->factors[3];
12161216
ne10_int32_t first_radix = S->factors[2];
1217-
ne10_int32_t step, f_count;
1217+
ne10_int32_t step = 0, f_count;
12181218
const ne10_fft_cpx_float32_t *src = input;
12191219
ne10_fft_cpx_float32_t *in;
12201220
ne10_fft_cpx_float32_t *dst = out;
@@ -1313,7 +1313,7 @@ void arm_ne10_mixed_radix_fft_backward_float32_neon (
13131313
ne10_int32_t mstride = S->factors[3];
13141314
ne10_int32_t first_radix = S->factors[2];
13151315
ne10_int32_t nfft = fstride * first_radix;
1316-
ne10_int32_t step, f_count;
1316+
ne10_int32_t step = 0, f_count;
13171317
const ne10_fft_cpx_float32_t *src = input;
13181318
ne10_fft_cpx_float32_t *in;
13191319
ne10_fft_cpx_float32_t *dst = out;

Ne10/NE10_fft_int16.neonintrinsic.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,7 +1026,7 @@ static void arm_ne10_mixed_radix_fft_forward_int16_##scaled##_neon (ne10_fft_cpx
10261026
ne10_fft_cpx_int16_t *Fout1; \
10271027
ne10_fft_cpx_int16_t *Fout_ls = Fout; \
10281028
ne10_fft_cpx_int16_t *Ftmp; \
1029-
const ne10_fft_cpx_int16_t *tw; \
1029+
const ne10_fft_cpx_int16_t *tw = twiddles; \
10301030
const ne10_fft_cpx_int16_t *tw1; \
10311031
\
10321032
/* init fstride, mstride, N */ \
@@ -1111,7 +1111,7 @@ static void arm_ne10_mixed_radix_fft_backward_int16_##scaled##_neon (ne10_fft_cp
11111111
ne10_fft_cpx_int16_t *Fout1; \
11121112
ne10_fft_cpx_int16_t *Fout_ls = Fout; \
11131113
ne10_fft_cpx_int16_t *Ftmp; \
1114-
const ne10_fft_cpx_int16_t *tw;\
1114+
const ne10_fft_cpx_int16_t *tw = twiddles;\
11151115
const ne10_fft_cpx_int16_t *tw1; \
11161116
\
11171117
/* init fstride, mstride, N */ \

Ne10/NE10_fft_int32.neonintrinsic.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,7 +1267,7 @@ static void arm_ne10_mixed_radix_fft_forward_int32_##scaled##_neon (ne10_fft_cpx
12671267
ne10_fft_cpx_int32_t *Fout1; \
12681268
ne10_fft_cpx_int32_t *Fout_ls = Fout; \
12691269
ne10_fft_cpx_int32_t *Ftmp; \
1270-
const ne10_fft_cpx_int32_t *tw;\
1270+
const ne10_fft_cpx_int32_t *tw = twiddles;\
12711271
const ne10_fft_cpx_int32_t *tw1; \
12721272
\
12731273
/* init fstride, mstride, N */ \
@@ -1353,7 +1353,7 @@ static void arm_ne10_mixed_radix_fft_backward_int32_##scaled##_neon (ne10_fft_cp
13531353
ne10_fft_cpx_int32_t *Fout1; \
13541354
ne10_fft_cpx_int32_t *Fout_ls = Fout; \
13551355
ne10_fft_cpx_int32_t *Ftmp; \
1356-
const ne10_fft_cpx_int32_t *tw; \
1356+
const ne10_fft_cpx_int32_t *tw = twiddles; \
13571357
const ne10_fft_cpx_int32_t *tw1; \
13581358
\
13591359
/* init fstride, mstride, N */ \

Source/MatrixFunctions/arm_mat_mult_f64.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ ARM_DSP_ATTRIBUTE arm_status arm_mat_mult_f64(
170170
acc5 = vdupq_n_f64(0.0);
171171
acc6 = vdupq_n_f64(0.0);
172172
acc7 = vdupq_n_f64(0.0);
173+
temp = vdupq_n_f64(0.0);
173174

174175
/* Compute 2 MACs simultaneously. */
175176
colCnt = numColsA >> 1U;
@@ -307,6 +308,7 @@ ARM_DSP_ATTRIBUTE arm_status arm_mat_mult_f64(
307308
pIn1 = pInA;
308309

309310
acc0 = vdupq_n_f64(0.0);
311+
temp = vdupq_n_f64(0.0);
310312

311313
/* Compute 4 MACs simultaneously. */
312314
colCnt = numColsA >> 1U;

0 commit comments

Comments
 (0)