https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107565
Bug ID: 107565
Summary: -Wanalyzer-use-of-uninitialized-value false positive
with rdrand
Product: gcc
Version: 12.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: analyzer
Assignee: dmalcolm at gcc dot gnu.org
Reporter: eggert at cs dot ucla.edu
Target Milestone: ---
Created attachment 53846
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53846&action=edit
test program illustrating the -fanalyzer false positive
This is gcc (GCC) 12.2.1 20220819 (Red Hat 12.2.1-2) on x86-64. Compile the
attached program with the command:
gcc -O2 -mrdrnd -fanalyzer -S t.c
GCC says "warning: use of uninitialized value ‘x’ [CWE-457]
[-Wanalyzer-use-of-uninitialized-value]". This is a false positive, as x cannot
possibly be uninitialized. Apparently -fanalyzer is confused about how
__builtin_ia32_rdrand64_step works.
GCC 11.3.0 does not issue this diagnostic, so this is a regression.