From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 861433858C2C for ; Thu, 28 Apr 2022 08:31:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 861433858C2C Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-524-CgWKtyxYOO2e9dTLT7vAiQ-1; Thu, 28 Apr 2022 04:31:17 -0400 X-MC-Unique: CgWKtyxYOO2e9dTLT7vAiQ-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 608073C37F27; Thu, 28 Apr 2022 08:31:17 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.16]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 21EB8434820; Thu, 28 Apr 2022 08:31:17 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.16.1/8.16.1) with ESMTPS id 23S8VEFo3123850 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 28 Apr 2022 10:31:14 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 23S8VEvn3123849; Thu, 28 Apr 2022 10:31:14 +0200 Date: Thu, 28 Apr 2022 10:31:13 +0200 From: Jakub Jelinek To: Uros Bizjak , gcc-patches@gcc.gnu.org Subject: Patch ping Re: [PATCH] i386: Fix up ix86_gimplify_va_arg [PR105331] Message-ID: Reply-To: Jakub Jelinek References: MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2022 08:31:21 -0000 Hi! I'd like to ping this patch. I know it isn't a full week yet, but we are almost out of P1s and GCC 12 branching is any time now. Thanks: On Fri, Apr 22, 2022 at 09:25:04AM +0200, Jakub Jelinek via Gcc-patches wrote: > 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. > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? > > 2022-04-22 Jakub Jelinek > > 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. Jakub