aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Carlstrom <bdc@google.com>2014-06-12 20:27:35 -0700
committerBrian Carlstrom <bdc@google.com>2014-06-12 20:32:22 -0700
commitf59a48c2daa687624b2404a48bd0fffd6baaf50d (patch)
treeeb81601c8a4ddc29c2d452b72001b5c797a745d4
parent5db5d6d307d80011811ffc0db7b29d882c7a631e (diff)
downloadstlport-f59a48c2daa687624b2404a48bd0fffd6baaf50d.tar.gz
Fix sincosf -> sincosf recursion
(cherry picked from commit ff4a56e1f49d950e522066e67c64951748a01cb5) Change-Id: Idbe25881ed66e26395126a80b55c6f4dbc1f0e29
-rw-r--r--src/sincos.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/sincos.c b/src/sincos.c
index 520aa7b..1c77f58 100644
--- a/src/sincos.c
+++ b/src/sincos.c
@@ -27,6 +27,14 @@
#define _GNU_SOURCE 1
#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.
+#pragma GCC optimize ("O0")
+
/*
* This file is almost the same as bionic/libm/sincos.c except
* we declare the function to have hiddlen visibility. The library