From patchwork Tue Aug 6 21:27:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 1969682 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=o6Mfk0aB; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Wdmcj57v2z1yfC for ; Wed, 7 Aug 2024 07:28:05 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 84EB8385DDD7 for ; Tue, 6 Aug 2024 21:28:03 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by sourceware.org (Postfix) with ESMTPS id 5C1B13858416 for ; Tue, 6 Aug 2024 21:27:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5C1B13858416 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=quicinc.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5C1B13858416 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722979651; cv=none; b=lML80cDihNxw7kS06cXBdQ4CJxgk/+mmJEqhyRCJSGhXc9946Zjpfq230OqAc7vlk+MsU8PZP8i/E2oLK0sFsHZRvyueG/y/lhk6tmFncxznqnIvxEHzHME3Z9a19X8cl/LL6bwAYh7+vn+To9UgI7/+TcXdyOAY4byDF2net4c= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722979651; c=relaxed/simple; bh=ztT3bvnYjEGPZws9WxYlneKoswDqr1N3hi8C93W5x5s=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=qAkvucVSMptrkFCosLUmt432kxLIOFfDkldAWZLTacFKVZNpVokKmDR/EYnDSSW4odZzQtTvICkUltIGyRtvSyH8B+kpAIySWI7JmS/lCd2Y4S7/pvw5cwRFOTJu+rGoe5bPthW/xQXLfE+uQyNGmXLB0t1mWzAfb4ujhaa6mDA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 476H6QlZ021566 for ; Tue, 6 Aug 2024 21:27:27 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= vDr7uei2Z0Kt2lVknkAHwENLHW+T1E1ze3NIo/cTCuo=; b=o6Mfk0aBd2wtBPYx 6zNs6WKfrDl9fiiYRzfHTQjqSkTcuowiBfUOw7TjUuQThGrocV1h6faAGfeLW4Y4 3mGa4Vh20S88TMue9o5+T5Yv5kgpJv5JSmbmybcSzm5dBPGqXHTCJPNEAY0of06c 8mrati+TwXOUh/GZTqhfTKk9HtciXqG/ot7cUP2uvmdJtscaW2/bfHIjRgnsxAmE ub3Xq9PUEiDHdR8cF9upeyRju0fgKIQDmUGvNqP1/xrBPhPqpTIWvSUi6LgcsT2I PxNM2tvE9iBUtwoNwCQX1SyxmlAAuxc5Xm7r/+IR9R1o9bwWkVAVKhNUhx3DGtpR ua2d0w== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 40sbgs0r1d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 06 Aug 2024 21:27:27 +0000 (GMT) Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA02.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 476LRQcC025286 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 6 Aug 2024 21:27:26 GMT Received: from hu-apinski-lv.qualcomm.com (10.49.16.6) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Tue, 6 Aug 2024 14:27:26 -0700 From: Andrew Pinski To: CC: Andrew Pinski Subject: [PATCH 5/5] ranger: Fix LTO uninitialized variable warning about m_range_tree Date: Tue, 6 Aug 2024 14:27:14 -0700 Message-ID: <20240806212714.308434-6-quic_apinski@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240806212714.308434-1-quic_apinski@quicinc.com> References: <20240806212714.308434-1-quic_apinski@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01b.na.qualcomm.com (10.47.209.197) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: ohWLtFMuYfdwaad_wfHy596iMzCWjXjZ X-Proofpoint-GUID: ohWLtFMuYfdwaad_wfHy596iMzCWjXjZ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-06_17,2024-08-06_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 impostorscore=0 malwarescore=0 suspectscore=0 phishscore=0 mlxscore=0 priorityscore=1501 lowpriorityscore=0 bulkscore=0 adultscore=0 spamscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2408060150 X-Spam-Status: No, score=-13.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org With LTO, initialize_integral_ops, initialize_integral_ops and initialize_float_ops are all inlined into the constructor of range_op_table, so you get an uninitialized warning about m_range_tree not being initialized due to it having a clobber at the begining of the constructor. This adds a value initialization for m_range_tree to have it initialized inside the constructor. This has a small startup cost since we are zeroing the whole array a second time though since we setting it later on to be, the cost of pulling it into the cache is going to be small. Bootstrapped and tested on x86_64-linux-gnu with no regressions. gcc/ChangeLog: * range-op.h (class range_op_table): Value initialize m_range_tree. Signed-off-by: Andrew Pinski --- gcc/range-op.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gcc/range-op.h b/gcc/range-op.h index f7ecc660fb9..265d3c21691 100644 --- a/gcc/range-op.h +++ b/gcc/range-op.h @@ -404,7 +404,12 @@ private: gcc_checking_assert (m_range_tree[code] == NULL); m_range_tree[code] = &op; } - range_operator *m_range_tree[RANGE_OP_TABLE_SIZE]; + + /* m_range_tree needs to be value initialized instead + of default initialized; otherwise it could be considered + as unitialized even though it is zero initialized due to + being a static variable, there is a clobber in the ctor. */ + range_operator *m_range_tree[RANGE_OP_TABLE_SIZE]{}; void initialize_integral_ops (); void initialize_pointer_ops (); void initialize_float_ops ();