Commit 4b223427 authored by Martin v. Löwis's avatar Martin v. Löwis

Issue #8847: Disable COMDAT folding in Windows PGO builds.

Analysis by Victor Stinner. Patch by Stefan Krah.
parent f29ea379
...@@ -70,6 +70,14 @@ class ListTest(list_tests.CommonTest): ...@@ -70,6 +70,14 @@ class ListTest(list_tests.CommonTest):
check(1000000) check(1000000)
def test_no_comdat_folding(self):
# Issue 8847: In the PGO build, the MSVC linker's COMDAT folding
# optimization causes failures in code that relies on distinct
# function addresses.
class L(list): pass
with self.assertRaises(TypeError):
(3,) + L([1,2])
def test_main(verbose=None): def test_main(verbose=None):
support.run_unittest(ListTest) support.run_unittest(ListTest)
......
...@@ -164,6 +164,14 @@ class TupleTest(seq_tests.CommonTest): ...@@ -164,6 +164,14 @@ class TupleTest(seq_tests.CommonTest):
check(10) # check our checking code check(10) # check our checking code
check(1000000) check(1000000)
def test_no_comdat_folding(self):
# Issue 8847: In the PGO build, the MSVC linker's COMDAT folding
# optimization causes failures in code that relies on distinct
# function addresses.
class T(tuple): pass
with self.assertRaises(TypeError):
[3,] + T((1,2))
def test_main(): def test_main():
support.run_unittest(TupleTest) support.run_unittest(TupleTest)
......
...@@ -425,6 +425,8 @@ Tests ...@@ -425,6 +425,8 @@ Tests
Build Build
----- -----
- Issue #8847: Disable COMDAT folding in Windows PGO builds.
- Issue #14197: For OS X framework builds, ensure links to the shared - Issue #14197: For OS X framework builds, ensure links to the shared
library are created with the proper ABI suffix. library are created with the proper ABI suffix.
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
OptimizeReferences="2" OptimizeReferences="2"
EnableCOMDATFolding="2" EnableCOMDATFolding="1"
LinkTimeCodeGeneration="2" LinkTimeCodeGeneration="2"
ProfileGuidedDatabase="$(SolutionDir)$(PlatformName)-pgi\$(TargetName).pgd" ProfileGuidedDatabase="$(SolutionDir)$(PlatformName)-pgi\$(TargetName).pgd"
ImportLibrary="$(OutDirPGI)\$(TargetName).lib" ImportLibrary="$(OutDirPGI)\$(TargetName).lib"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment