From patchwork Mon Dec 18 16:34:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 1877510 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=c2iXZtKv; 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 4Sv55h2FWZz23yq for ; Tue, 19 Dec 2023 03:35:02 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8581C3857C4F for ; Mon, 18 Dec 2023 16:35:00 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by sourceware.org (Postfix) with ESMTPS id 708D93858292 for ; Mon, 18 Dec 2023 16:34:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 708D93858292 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 708D93858292 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702917290; cv=none; b=XgXEhAyTLe5qD/U0Y2snmvQUeJqFmDL+WpqXjgCbZBKkqnlEffiWfc1T7pLf45F6GFKcB8i2IioZO+nCIeEzrFdHHX5/QAf9AaeXhzmShddUyYNgjokJVKooHfrdouHJ5ZOOBLdVUtUxK8bJQFT/oPyDbw1erSuhf8n7Vjcspn8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702917290; c=relaxed/simple; bh=O1XoOTm4c8EHkP6uXMESJWrI9P5UYloLKY8pE1lXBhU=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=KukkwMzXPk/FyPG7g0nGxTWhNLnoModWp4YVh8YAKKOMRCtUQnjAbxvmMLU4lf+f16SgfAWrlrUthZZwyqe4M9f5EgVIgt/miHoq002i3+PKEtBVzxNtgWnrXQ9ia7Zmn0jRqHOSgiALgbDe7DQIhUbDyZ0WDwjofYNRSFnFUks= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BIAt98L020633 for ; Mon, 18 Dec 2023 16:34:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:content-type; s=qcppdkim1; bh=RQVA02s n7PIy4dvHbIH+PXbQX1SurnXmyu1rG0ZJxio=; b=c2iXZtKvMHjTQxce4d/ljKc 3xkhNXkKE0HO2yR8gpJxmVZaN3piCmZHfx5XmLDDi5XnBIyd0yI4lXaosIicbVn/ Cpkzf8/2e5Ki8x7Nwr0otwn+DeTHTzTv9qsDQDpmxqP8xkvPWERU+lYQadRUK4+v rTstAN1KyR6nu53RLwCTDi8z9VPPPODxCtsnSb8MfW0cEYJBNcjJky4+Dv+DNJg9 89NeXqKmnFHvQy6VlzdNAKa0YdKVNQQX2DQQPGRnZTcW4Y2UEl2W6g9Ke1RHhLE6 Rh9vJSCZl6liOGp5RBtrtTs6293F23Vtwkkfm0EOED4zyRtiY5DojD6NJfoi78w= = Received: from nasanppmta05.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3v2gw0sdae-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 18 Dec 2023 16:34:39 +0000 (GMT) Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3BIGYc8H026206 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 18 Dec 2023 16:34:38 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.1118.40; Mon, 18 Dec 2023 08:34:38 -0800 From: Andrew Pinski To: CC: Andrew Pinski Subject: [COMMITTED] SCCP: Fix ODR issues when compiling with LTO [PR 113054} Date: Mon, 18 Dec 2023 08:34:24 -0800 Message-ID: <20231218163424.1066771-1-quic_apinski@quicinc.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01a.na.qualcomm.com (10.47.209.196) 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-GUID: 6-ELIfio86SjoTkxawH2VIoHJQGYfrBm X-Proofpoint-ORIG-GUID: 6-ELIfio86SjoTkxawH2VIoHJQGYfrBm X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_02,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 impostorscore=0 mlxscore=0 adultscore=0 malwarescore=0 suspectscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxlogscore=939 phishscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312180122 X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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 The problem here is that in C++ structs and classes have a linkage too so the type vertex is not considered local to the TU but will conflict with the globally defined one in graphds.h. The simple way to fix this is to wrap the ones defined locally in gimple-ssa-sccopy.cc inside an anonymous namespace and they are now considered locally to that TU. Committed as obvious after a bootstrap/test on x86_64. gcc/ChangeLog: PR tree-optimization/113054 * gimple-ssa-sccopy.cc: Wrap the local types with an anonymous namespace. Signed-off-by: Andrew Pinski --- gcc/gimple-ssa-sccopy.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gcc/gimple-ssa-sccopy.cc b/gcc/gimple-ssa-sccopy.cc index 7ebb6c05caf..19a656e2822 100644 --- a/gcc/gimple-ssa-sccopy.cc +++ b/gcc/gimple-ssa-sccopy.cc @@ -95,6 +95,7 @@ along with GCC; see the file COPYING3. If not see /* Bitmap tracking statements which were propagated to be removed at the end of the pass. */ +namespace { static bitmap dead_stmts; /* State of vertex during SCC discovery. @@ -334,6 +335,8 @@ scc_discovery::compute_sccs (vec &stmts) return sccs; } +} // anon namespace + /* Could this statement potentially be a copy statement? This pass only considers statements for which this function returns 'true'.