public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/105331] [11/12 Regression] -Wmaybe-uninitialized warning on va_arg with double _Complex on va_list pointer Date: Thu, 28 Apr 2022 10:35:24 +0000 [thread overview] Message-ID: <bug-105331-4-dhNKxY2xfP@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-105331-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105331 --- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>: https://gcc.gnu.org/g:89dbf9a5f55e0f7565865d1b38e681ef7d76afaf commit r12-8301-g89dbf9a5f55e0f7565865d1b38e681ef7d76afaf Author: Jakub Jelinek <jakub@redhat.com> Date: Thu Apr 28 12:33:59 2022 +0200 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.
next prev parent reply other threads:[~2022-04-28 10:35 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-04-21 8:46 [Bug c/105331] New: " kamilcukrowski at gmail dot com 2022-04-21 9:03 ` [Bug middle-end/105331] [11/12 Regression] " jakub at gcc dot gnu.org 2022-04-21 9:07 ` jakub at gcc dot gnu.org 2022-04-21 10:17 ` [Bug target/105331] " jakub at gcc dot gnu.org 2022-04-21 11:03 ` rguenth at gcc dot gnu.org 2022-04-21 11:06 ` jakub at gcc dot gnu.org 2022-04-28 10:35 ` cvs-commit at gcc dot gnu.org [this message] 2022-04-28 10:36 ` [Bug target/105331] [11 " jakub at gcc dot gnu.org 2022-05-06 23:44 ` cvs-commit at gcc dot gnu.org 2022-05-09 11:25 ` jakub at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-105331-4-dhNKxY2xfP@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).