PATCH: [perl #116787] -Ox on Win64 Visual C 64 bit is flawed, switch to -O1
authorDaniel Dragan <bulk88@hotmail.com>
Thu, 21 Feb 2013 08:42:13 +0000 (08:42 +0000)
committerSteve Hay <steve.m.hay@googlemail.com>
Thu, 21 Feb 2013 08:42:52 +0000 (08:42 +0000)
-Ox is missing -GF and -Gy and -Gs
http://blogs.msdn.com/b/branbray/archive/2005/07/08/437078.aspx
http://msdn.microsoft.com/en-us/library/8f8h5cxt%28v=vs.90%29.aspx
http://msdn.microsoft.com/en-us/library/59a3b321%28v=vs.90%29.aspx

So the remaining question is, use -O1 or use -O2 on VC 64? VC 32 bit uses
-O1, and that is also slightly faster on x64 too.

win32/Makefile
win32/makefile.mk

index 221f096..7631eae 100644 (file)
@@ -439,7 +439,7 @@ LINK_DBG    = -debug -opt:ref,icf
 #LINK_DBG      = $(LINK_DBG) -debugtype:both
 !  IF "$(WIN64)" == "define"
 # enable Whole Program Optimizations (WPO) and Link Time Code Generation (LTCG)
-OPTIMIZE       = $(OPTIMIZE) -Ox -GL
+OPTIMIZE       = $(OPTIMIZE) -O1 -GL
 LINK_DBG       = $(LINK_DBG) -ltcg
 !  ELSE
 # -O1 yields smaller code, which turns out to be faster than -O2 on x86
index 2d396c0..8a196a6 100644 (file)
@@ -503,7 +503,7 @@ LINK_DBG    = -debug -opt:ref,icf
 #LINK_DBG      = $(LINK_DBG) -debugtype:both
 .IF "$(WIN64)" == "define"
 # enable Whole Program Optimizations (WPO) and Link Time Code Generation (LTCG)
-OPTIMIZE       += -Ox -GL
+OPTIMIZE       += -O1 -GL
 LINK_DBG       += -ltcg
 .ELSE
 # -O1 yields smaller code, which turns out to be faster than -O2 on x86