chiark / gitweb /
fix compilation problem with MSVC (#131)
authorSteven G. Johnson <stevenj@mit.edu>
Fri, 28 Jul 2017 19:48:08 +0000 (15:48 -0400)
committerGitHub <noreply@github.com>
Fri, 28 Jul 2017 19:48:08 +0000 (15:48 -0400)
* fix for #51

This pragma fixes a known problem compiling with VS2013 or VS2015 in Release.
See issue #51 for more info.

* The fix fod Visual Studio starts from version 2013 onwards.

This has not been fixed for VS2015, so we keep the macro guard open for future versions of VS.
The vectorization of this loop is not that important anyways.
See #51.

cobyla/cobyla.c

index ce394d8bd189b9a15ffbef81e2513bfbec8d51f1..ca4219a15683a7bf06b9e71a9cb7f1cebaa11d6f 100644 (file)
@@ -1505,6 +1505,12 @@ L130:
 /* new value of ZDOTA(NACT) and branch if it is not acceptable. */
 
   i__1 = nact;
+  
+/* This pragma fixes a known problem compiling with VS2013 or VS2015 in Release */
+/* see https://connect.microsoft.com/VisualStudio/feedback/details/1028781/c1001-on-release-build */
+#if defined(_MSC_VER) && _MSC_VER >= 1800
+  #pragma loop(no_vector)
+#endif
   for (k = 1; k <= i__1; ++k) {
     d__1 = 0., d__2 = vmultc[k] - ratio * vmultd[k];
     vmultc[k] = MAX2(d__1,d__2);