aboutsummaryrefslogtreecommitdiff
path: root/libgcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2022-04-28 12:33:59 +0200
committerJakub Jelinek <jakub@redhat.com>2022-04-28 12:33:59 +0200
commit89dbf9a5f55e0f7565865d1b38e681ef7d76afaf (patch)
treee54771b4494e2b4a7f0eedb788597b67b1c14be2 /libgcc
parent8094526109034c6c6af44de47612e97319b2c7c5 (diff)
downloadgcc-89dbf9a5f55e0f7565865d1b38e681ef7d76afaf.zip
gcc-89dbf9a5f55e0f7565865d1b38e681ef7d76afaf.tar.gz
gcc-89dbf9a5f55e0f7565865d1b38e681ef7d76afaf.tar.bz2
i386: Fix up ix86_gimplify_va_arg [PR105331]
On the following testcase we emit a bogus 'va_arg_tmp.5' may be used uninitialized warning. The reason is that when gimplifying the addr = &temp; statement, the va_arg_tmp temporary var for which we emit ADDR_EXPR is not TREE_ADDRESSABLE, prepare_gimple_addressable emits some extra code to initialize the newly addressable var from its previous value, but it is a new variable which hasn't been initialized yet and will be later, so we end up initializing it with uninitialized SSA_NAME: va_arg_tmp.6 = va_arg_tmp.5_14(D); addr.2_16 = &va_arg_tmp.6; _17 = MEM[(double *)sse_addr.4_13]; MEM[(double * {ref-all})addr.2_16] = _17; and with -O1 we actually don't DSE it before the warning is emitted. If we make the temp TREE_ADDRESSABLE before the gimplification, then this prepare_gimple_addressable path isn't taken and we effectively omit the first statement above and so the bogus warning is gone. I went through other backends and didn't find another instance of this problem. 2022-04-28 Jakub Jelinek <jakub@redhat.com> PR target/105331 * config/i386/i386.cc (ix86_gimplify_va_arg): Mark va_arg_tmp temporary TREE_ADDRESSABLE before trying to gimplify ADDR_EXPR of it. * gcc.dg/pr105331.c: New test.
Diffstat (limited to 'libgcc')
0 files changed, 0 insertions, 0 deletions