aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Pinski <quic_apinski@quicinc.com>2023-12-18 08:18:13 -0800
committerAndrew Pinski <quic_apinski@quicinc.com>2023-12-18 08:35:48 -0800
commit4554a151d0ec62332c332175ec1017f853006b60 (patch)
tree31da24e2a0e3c950396cf0d907e4234581cb29a2
parent88a398a487ee37f1fc7850740f2d94d895657646 (diff)
downloadgcc-4554a151d0ec62332c332175ec1017f853006b60.zip
gcc-4554a151d0ec62332c332175ec1017f853006b60.tar.gz
gcc-4554a151d0ec62332c332175ec1017f853006b60.tar.bz2
SCCP: Fix ODR issues when compiling with LTO [PR 113054}
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 <quic_apinski@quicinc.com>
-rw-r--r--gcc/gimple-ssa-sccopy.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/gimple-ssa-sccopy.cc b/gcc/gimple-ssa-sccopy.cc
index 7ebb6c0..19a656e 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<gimple *> &stmts)
return sccs;
}
+} // anon namespace
+
/* Could this statement potentially be a copy statement?
This pass only considers statements for which this function returns 'true'.