components/erlang/patches/math_exp_sparc.patch
author Matt Keenan <matt.keenan@oracle.com>
Fri, 29 Apr 2016 22:16:02 +0100
changeset 5886 abaafa90488e
permissions -rw-r--r--
22811465 math:exp() throws badarith exception on SPARC
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5886
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
     1
Fixes bug 22811465 - math:exp() throws badarith exception on SPARC
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
     2
Fix was recommended by upstream Erlang/OTP team and is being applied to trunk.
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
     3
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
     4
--- otp_src_17.5-ORIG/erts/emulator/sys/ose/sys_float.c	2016-04-19 13:16:27.190731082 +0100
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
     5
+++ otp_src_17.5/erts/emulator/sys/ose/sys_float.c	2016-04-19 13:18:30.669678699 +0100
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
     6
@@ -835,10 +835,5 @@
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
     7
 int
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
     8
 matherr(struct exception *exc)
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
     9
 {
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
    10
-#if !defined(NO_FPE_SIGNALS)
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
    11
-    volatile unsigned long *fpexnp = erts_get_current_fp_exception();
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
    12
-    if (fpexnp != NULL)
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
    13
-	*fpexnp = (unsigned long)__builtin_return_address(0);
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
    14
-#endif
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
    15
     return 1;
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
    16
 }
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
    17
--- otp_src_17.5-ORIG/erts/emulator/sys/unix/sys_float.c	2016-04-19 13:16:27.187000925 +0100
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
    18
+++ otp_src_17.5/erts/emulator/sys/unix/sys_float.c	2016-04-19 13:18:22.503799817 +0100
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
    19
@@ -837,11 +837,6 @@
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
    20
 int
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
    21
 matherr(struct exception *exc)
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
    22
 {
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
    23
-#if !defined(NO_FPE_SIGNALS)
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
    24
-    volatile unsigned long *fpexnp = erts_get_current_fp_exception();
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
    25
-    if (fpexnp != NULL)
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
    26
-	*fpexnp = (unsigned long)__builtin_return_address(0);
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
    27
-#endif
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
    28
     return 1;
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
    29
 }
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
    30
 
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
    31
--- otp_src_17.5-ORIG/erts/emulator/sys/win32/sys_float.c	2016-04-19 13:16:27.187779815 +0100
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
    32
+++ otp_src_17.5/erts/emulator/sys/win32/sys_float.c	2016-04-19 13:19:05.229444947 +0100
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
    33
@@ -138,8 +138,7 @@
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
    34
 int
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
    35
 matherr(struct _exception *exc)
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
    36
 {
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
    37
-    erl_fp_exception = 1;
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
    38
-    DEBUGF(("FP exception (matherr) (0x%x) (%d)\n", exc->type, erl_fp_exception));
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
    39
+    DEBUGF(("FP exception (matherr) (0x%x)\n", exc->type));
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
    40
     return 1;
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
    41
 }
abaafa90488e 22811465 math:exp() throws badarith exception on SPARC
Matt Keenan <matt.keenan@oracle.com>
parents:
diff changeset
    42