libm/libm: disable optimization for sincos
Disable sincos optimization for all functions in this file, otherwise gcc would generate infinite calls. Refer to gcc bug 46926. -fno-builtin-sin or -fno-builtin-cos can disable sincos optimization, but these two options do not work inside optimize pragma in-file. Thus we just enforce -O0 when compiling this file. Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
This commit is contained in:
parent
c5d1eaae72
commit
23b2f96c9d
@ -27,12 +27,21 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
/* Disable sincos optimization for all functions in this file,
|
||||
* otherwise gcc would generate infinite calls.
|
||||
* Refer to gcc PR46926.
|
||||
* -fno-builtin-sin or -fno-builtin-cos can disable sincos optimization,
|
||||
* but these two options do not work inside optimize pragma in-file.
|
||||
* Thus we just enforce -O0 when compiling this file.
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_HAVE_DOUBLE
|
||||
|
||||
nooptimiziation_function
|
||||
void sincos(double x, double *s, double *c)
|
||||
{
|
||||
*s = sin(x);
|
||||
|
@ -27,10 +27,19 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
/* Disable sincos optimization for all functions in this file,
|
||||
* otherwise gcc would generate infinite calls.
|
||||
* Refer to gcc PR46926.
|
||||
* -fno-builtin-sin or -fno-builtin-cos can disable sincos optimization,
|
||||
* but these two options do not work inside optimize pragma in-file.
|
||||
* Thus we just enforce -O0 when compiling this file.
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
nooptimiziation_function
|
||||
void sincosf(float x, float *s, float *c)
|
||||
{
|
||||
*s = sinf(x);
|
||||
|
@ -27,12 +27,21 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
/* Disable sincos optimization for all functions in this file,
|
||||
* otherwise gcc would generate infinite calls.
|
||||
* Refer to gcc PR46926.
|
||||
* -fno-builtin-sin or -fno-builtin-cos can disable sincos optimization,
|
||||
* but these two options do not work inside optimize pragma in-file.
|
||||
* Thus we just enforce -O0 when compiling this file.
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_DOUBLE
|
||||
|
||||
nooptimiziation_function
|
||||
void sincosl(long double x, long double *s, long double *c)
|
||||
{
|
||||
*s = sinl(x);
|
||||
|
Loading…
Reference in New Issue
Block a user