summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2012-08-01 09:09:55 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2012-08-01 09:09:55 (GMT)
commita562ed012d70ad21320c468042ad9da19832cf18 (patch)
tree784280fbd109ce521047898740458fb39cf2a04d
parentd49b323270970bc8579bb59eba65235e9bc31fb3 (diff)
parent4c1730db7c8735d2424471e63a2fa7d690192899 (diff)
downloadcpython-a562ed012d70ad21320c468042ad9da19832cf18.zip
cpython-a562ed012d70ad21320c468042ad9da19832cf18.tar.gz
cpython-a562ed012d70ad21320c468042ad9da19832cf18.tar.bz2
Issue #8847: Merge with 3.2
-rw-r--r--Lib/test/test_list.py8
-rw-r--r--Lib/test/test_tuple.py8
-rw-r--r--Misc/NEWS2
-rw-r--r--PC/VS9.0/pginstrument.vsprops2
4 files changed, 19 insertions, 1 deletions
diff --git a/Lib/test/test_list.py b/Lib/test/test_list.py
index 302c1d8..5df27d3 100644
--- a/Lib/test/test_list.py
+++ b/Lib/test/test_list.py
@@ -98,6 +98,14 @@ class ListTest(list_tests.CommonTest):
d = pickle.dumps(it)
self.assertEqual(self.type2test(it), self.type2test(reversed(data))[1:])
+ 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):
support.run_unittest(ListTest)
diff --git a/Lib/test/test_tuple.py b/Lib/test/test_tuple.py
index d928db2..e41711c 100644
--- a/Lib/test/test_tuple.py
+++ b/Lib/test/test_tuple.py
@@ -193,6 +193,14 @@ class TupleTest(seq_tests.CommonTest):
d = pickle.dumps(it)
self.assertEqual(self.type2test(it), self.type2test(reversed(data))[1:])
+ 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():
support.run_unittest(TupleTest)
diff --git a/Misc/NEWS b/Misc/NEWS
index b1df727..f4dae73 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -276,6 +276,8 @@ Tests
Build
-----
+- Issue #8847: Disable COMDAT folding in Windows PGO builds.
+
- Issue #14018: Fix OS X Tcl/Tk framework checking when using OS X SDKs.
- Issue #15431: Add _freeze_importlib project to regenerate importlib.h
diff --git a/PC/VS9.0/pginstrument.vsprops b/PC/VS9.0/pginstrument.vsprops
index 38c5f18..99c117b 100644
--- a/PC/VS9.0/pginstrument.vsprops
+++ b/PC/VS9.0/pginstrument.vsprops
@@ -22,7 +22,7 @@
<Tool
Name="VCLinkerTool"
OptimizeReferences="2"
- EnableCOMDATFolding="2"
+ EnableCOMDATFolding="1"
LinkTimeCodeGeneration="2"
ProfileGuidedDatabase="$(SolutionDir)$(PlatformName)-pgi\$(TargetName).pgd"
ImportLibrary="$(OutDirPGI)\$(TargetName).lib"