Skip to content

vecRevA used uninitialized in Levinson-Durbin MVE implementation #303

Description

@Symanyshyn-IFX

The Helium/MVE-optimized Levinson-Durbin functions reads from an uninitialized vector variable vecRevA on its first vsetq_lane_u64() call. The uninitialized lane value is discarded (overwritten on the next line), so there is no functional impact, but it is technically undefined behavior and triggers a warning on IAR.

Affected files:

vecRevA = (f32x4_t) vsetq_lane_u64(tmpb,(uint64x2_t)vecRevA,0);

vecRevA = (f16x8_t) vsetq_lane_u64(tmpb,(uint64x2_t)vecRevA,0);

vecRevA = (q31x4_t) vsetq_lane_u64(tmpb,(uint64x2_t)vecRevA,0);

All three files have the same code pattern and the same bug.

Warning observed:

"arm_levinson_durbin_f32.c",169  Warning[Go029]: Variable "vecRevA" is used
    uninitialized at this location in the sourcecode.

"arm_levinson_durbin_f16.c",166  Warning[Go029]: Variable "vecRevA" is used
    uninitialized at this location in the sourcecode.

"arm_levinson_durbin_q31.c",238  Warning[Go029]: Variable "vecRevA" is used
    uninitialized at this location in the sourcecode.

Compiler: IAR C/C++ Compiler for Arm V9.70.1
Target: Cortex-M55
Build flags: --cpu Cortex-M55 -Ohz --fpu FPv5_D16 --aapcs vfp --endian=little -e --enable_restrict --no_wrap_diagnostics --no_dwarf4

Metadata

Metadata

Assignees

No one assigned

    Labels

    DONEIssue done but not yet closedduplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions