Skip to content

[X86] Uninitialized variable warnings in immintrin.h - static analyzer - __builtin_ia32_rdsspd / __builtin_ia32_rdsspq #149289

@buscher

Description

@buscher

Kind of related to #55224 , but for the static analyzer.

For the code

#include <x86intrin.h>

int main() {
    return 0;
}

when I execute:

scan-build -analyze-headers cc main.c

I get:

scan-build: Using '/usr/lib/llvm-20/bin/clang' for static analysis
In file included from main.c:2:
In file included from /usr/lib/llvm-20/lib/clang/20/include/x86intrin.h:15:
In file included from /usr/lib/llvm-20/lib/clang/20/include/immintrin.h:577:
/usr/lib/llvm-20/lib/clang/20/include/cetintrin.h:49:10: warning: 1st function call argument is an uninitialized value [core.CallAndMessage]
   49 |   return __builtin_ia32_rdsspd(t);
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/llvm-20/lib/clang/20/include/cetintrin.h:62:10: warning: 1st function call argument is an uninitialized value [core.CallAndMessage]
   62 |   return __builtin_ia32_rdsspq(t);
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.

Happens with llvm/clang 14 and 20, did not test other versions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions