Suppress uninitialized warnings for new created uses from __builtin_clear_padding...
authorQing Zhao <qing.zhao@oracle.com>
Mon, 28 Feb 2022 15:58:43 +0000 (15:58 +0000)
committerQing Zhao <qing.zhao@oracle.com>
Mon, 28 Feb 2022 15:58:43 +0000 (15:58 +0000)
commit3f3246eb16f554c70c5ce87ad2c785f83adb4625
treea062d29bb8293c9752e89a20e059d0472321b846
parent1060d06b4df8836135ed15d020afbd3637dc625b
Suppress uninitialized warnings for new created uses from __builtin_clear_padding folding [PR104550]

__builtin_clear_padding(&object) will clear all the padding bits of the object.
actually, it doesn't involve any use of an user variable. Therefore, users do
not expect any uninitialized warning from it. It's reasonable to suppress
uninitialized warnings for all new created uses from __builtin_clear_padding
folding.

PR middle-end/104550

gcc/ChangeLog:

* gimple-fold.cc (clear_padding_flush): Suppress warnings for new
created uses.

gcc/testsuite/ChangeLog:

* gcc.dg/auto-init-pr104550-1.c: New test.
* gcc.dg/auto-init-pr104550-2.c: New test.
* gcc.dg/auto-init-pr104550-3.c: New test.
gcc/gimple-fold.cc
gcc/testsuite/gcc.dg/auto-init-pr104550-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/auto-init-pr104550-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/auto-init-pr104550-3.c [new file with mode: 0644]