[Python-checkins] cpython (merge 3.2 -> default): Issue #8847: Merge with 3.2

martin.v.loewis python-checkins at python.org
Wed Aug 1 11:11:13 CEST 2012


http://hg.python.org/cpython/rev/d3afe5d8a4da
changeset:   78368:d3afe5d8a4da
parent:      78367:029cde4e58c5
parent:      78366:2638ce032151
user:        Martin v. Löwis <martin at v.loewis.de>
date:        Wed Aug 01 11:09:55 2012 +0200
summary:
  Issue #8847: Merge with 3.2

files:
  Lib/test/test_list.py         |  8 ++++++++
  Lib/test/test_tuple.py        |  8 ++++++++
  Misc/NEWS                     |  2 ++
  PC/VS9.0/pginstrument.vsprops |  2 +-
  4 files changed, 19 insertions(+), 1 deletions(-)


diff --git a/Lib/test/test_list.py b/Lib/test/test_list.py
--- a/Lib/test/test_list.py
+++ b/Lib/test/test_list.py
@@ -98,6 +98,14 @@
         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
--- a/Lib/test/test_tuple.py
+++ b/Lib/test/test_tuple.py
@@ -193,6 +193,14 @@
         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
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -276,6 +276,8 @@
 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
--- 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"

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list