gcc-debug problems converting numbers to strings

VERIFIED FIXED

Status

()

VERIFIED FIXED
17 years ago
14 years ago

People

(Reporter: pschwartau, Assigned: bryner)

Tracking

Trunk
x86
Linux
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

(Reporter)

Description

17 years ago
It looks like the fix for bug 102725, "gcc -O2 problems converting numbers
to strings", has caused a regression in the debug JS shell on Linux.

I should have reported this sooner, but I missed this in my own testing
data. It only happens to me on Linux, and only in the debug JS shell,
not the optimized shell. I am using gcc version 2.95.3 20010315 (release).


Here is how to reproduce the bug: 

var n = 
17976931348623158079372897140530341507993413271003782693617377898044496829276475
09466490179775872070963302864166928879109465555478519404026306574886715058206819
08902000708383676273854845817711531764475730270069855571366959622842914819860834
936475292719074168444365510704342711559699508093042880177904174497792;

print(n);

On WinNT, Mac9.1, and Linux optimized, this outputs "Infinity".
On Linux debug, it outputs "NaN" instead, which is causing the
following testcase to fail in the debug shell:

            mozilla/tests/ecma/TypeConversion/9.3.1-1.js


Note the checkins made for bug 102725 consisted of: 

                   jsnum.h   version 3.12 
                   jsdtoa.c  version 3.14

If I revert these to versions 3.11, 3.13, respectively, the bug goes away.
Hence allow me to assign this one to Brian, and cc people from bug 102725.
(Reporter)

Comment 1

17 years ago
Created attachment 62981 [details]
Standalone JS shell testcase: should output "Infinity"
(Reporter)

Comment 2

17 years ago
Created attachment 62982 [details]
HTML version of the testcase
(Reporter)

Comment 3

17 years ago
Typo above: the testsuite failure is

          mozilla/js/tests/ecma/TypeConversion/9.3.1-1.js

The reduced testcase I've provided, however, captures the problem -

(Assignee)

Comment 4

17 years ago
I can't reproduce this on gcc 2.96-85... perhaps it's specific to 2.95.3?  I'll
do a build with that when I get a chance.
Status: NEW → ASSIGNED
(Assignee)

Comment 5

17 years ago
Confirmed that this occurs in a debug build with gcc 2.95.3.
(Assignee)

Comment 6

17 years ago
Created attachment 63933 [details] [diff] [review]
hack-around patch

This patch makes it so the new code is only used for gcc 2.96 and higher.
Comment on attachment 63933 [details] [diff] [review]
hack-around patch

sr=brendan@mozilla.org
Attachment #63933 - Flags: superreview+

Updated

17 years ago
Attachment #63933 - Flags: review+
(Assignee)

Comment 8

17 years ago
checked in.
Status: ASSIGNED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED
(Reporter)

Comment 9

17 years ago
Verified FIXED with JS optimized and debug shells built today at 12:00.

All tests in mozilla/js/tests/ecma/TypeConversion are now passing,
and the standalone JS shell testcase above now outputs "Infinity" 
in both shells on WinNT, Linux, and Mac9.1.
Status: RESOLVED → VERIFIED

Updated

14 years ago
Flags: testcase+
You need to log in before you can comment on or make changes to this bug.