File workaround-gcc-issue-on-i586.patch of Package sphinxbase

From: Antonio Larrosa <alarrosa@suse.com>
Subject: Workaround a gcc issue on i586

This is a workaround to circumvent
https://bugzilla.opensuse.org/show_bug.cgi?id=1127564

Index: sphinxbase-0.8/src/libsphinxbase/util/logmath.c
===================================================================
--- sphinxbase-0.8.orig/src/libsphinxbase/util/logmath.c
+++ sphinxbase-0.8/src/libsphinxbase/util/logmath.c
@@ -449,7 +449,9 @@ logmath_log(logmath_t *lmath, float64 p)
     if (p <= 0) {
         return lmath->zero;
     }
-    return (int)(log(p) * lmath->inv_log_of_base) >> lmath->t.shift;
+    double g1 = log(p);
+    double g3 = g1 * lmath->inv_log_of_base;
+    return (int)g3 >> lmath->t.shift;
 }
 
 float64
Index: sphinxbase-0.8/include/sphinxbase/logmath.h
===================================================================
--- sphinxbase-0.8.orig/include/sphinxbase/logmath.h
+++ sphinxbase-0.8/include/sphinxbase/logmath.h
@@ -197,7 +197,7 @@ int logmath_add(logmath_t *lmath, int lo
  * Convert linear floating point number to integer log in base B.
  */
 SPHINXBASE_EXPORT
-int logmath_log(logmath_t *lmath, float64 p);
+int logmath_log(logmath_t *lmath, float64 p) __attribute__((optimize("-O0")));
 
 /**
  * Convert integer log in base B to linear floating point.
openSUSE Build Service is sponsored by