21181760 Workaround for Studio 12.1 optimization issue with libGSL in Solaris 11.3
--- a/components/libgsl/Makefile Tue Jun 02 08:44:38 2015 +0100
+++ b/components/libgsl/Makefile Tue Jun 02 03:51:56 2015 -0700
@@ -54,14 +54,6 @@
COMPONENT_PREP_ACTION = \
(cd $(@D) ; ACLOCAL=aclocal-1.11 AUTOMAKE=automake-1.11 autoreconf -f)
-# Prevent the test_linear() interpolation test core dumping when compiled
-# with -xO3 (or higher) with Studio 12.1. This is not a problem with Studio
-# 12.4. CR 20918528 - "Optimization problem with -xO4 for GSL test case."
-# has been filed for this problem.
-# Changed globally because it's unclear what other problems the higher
-# optimization level might cause GSL with Studio 12.1.
-studio_OPT = -xO2
-
LDFLAGS += $(CC_BITS)
LDFLAGS += $(studio_PIC)
LDFLAGS += $(studio_OPT)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/libgsl/patches/fix-linear-optimization.patch Tue Jun 02 03:51:56 2015 -0700
@@ -0,0 +1,17 @@
+Fix an optimization issue seen with Studion 12.1 with Solaris 11.3 when
+compiling with -xO4. The problem has been fixed in Studio 12.4, so the
+issue will go away when the Solaris 11.X release updates to that in its CBE.
+
+This patch will not be sent upstream.
+
+--- gsl-1.16/interpolation/linear.c.orig 2015-06-01 15:58:46.278682889 -0700
++++ gsl-1.16/interpolation/linear.c 2015-06-01 16:28:26.000366577 -0700
+@@ -157,7 +157,7 @@
+ *result = 0.0;
+
+ /* interior intervals */
+- for(i=index_a; i<=index_b; i++) {
++ for(i=index_a; i<index_b+1; i++) {
+ const double x_hi = x_array[i + 1];
+ const double x_lo = x_array[i];
+ const double y_lo = y_array[i];