Closed Bug 899712 Opened 11 years ago Closed 11 years ago

Prevent infinite recursion in fallback asinh

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla26

People

(Reporter: sfink, Assigned: sfink)

Details

Attachments

(1 file, 1 obsolete file)

I am seeing a test failure in js/src/tests/ecma_6/Math/asinh-exact.js and asinh-approx.js. If !HAVE_ASINH (which was erroneously true on Linux until recently, I gather?), then Math.asinh(-Infinity) will go into infinite recursion (or in an opt build, an infinite loop.)

Specifically, in

  double asinh(double x)
  {
      if (x <= -FOURTH_ROOT_EPSILON) {
          return -asinh(-x);
      }
  }

instead of generating code for -asinh(-x), gcc emits code for asinh(x) and immediately recurses. 

jorendorff's hypothesis is that gcc knows that asinh is special, and in particular that asinh(x) == -asinh(-x), but neglects to invalidate that knowledge when ainh is being overridden.
Rename the function
> jorendorff's hypothesis is that gcc knows that asinh is special, and in
> particular that asinh(x) == -asinh(-x), but neglects to invalidate that
> knowledge when ainh is being overridden.

That sounds like a gcc bug.
Ok, bug number embedded in a comment and ridiculously dumb bugs fixed. (Thanks, mjrosenb!)
Attachment #783299 - Flags: review?(jorendorff)
Attachment #783286 - Attachment is obsolete: true
Attachment #783299 - Flags: review?(jorendorff) → review+
https://hg.mozilla.org/mozilla-central/rev/025be6169eac
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: