Closed Bug 1122403 Opened 9 years ago Closed 9 years ago

Differential Testing: Different output message involving asm.js

Categories

(Core :: JavaScript Engine: JIT, defect)

x86
macOS
defect
Not set
major

Tracking

()

RESOLVED FIXED
mozilla38
Tracking Status
firefox38 --- affected

People

(Reporter: gkw, Assigned: sunfish)

References

Details

(Keywords: regression, testcase)

Attachments

(1 file)

function g() {
    "use asm";
    function f() {
        return (1 & (1 / 0xffffffff)) | 0
    }
    return f
}
print(g()())

$ ./js-dbg-opt-32-dm-nsprBuild-darwin-89a190592267 --fuzzing-safe --no-threads --ion-eager 6059.js
1

$ ./js-dbg-opt-32-dm-nsprBuild-darwin-89a190592267 --fuzzing-safe --no-threads --baseline-eager --no-fpu 6059.js
0

Tested this on m-c rev 89a190592267.

My configure flags are:

LD=ld CROSS_COMPILE=1 CC="clang -Qunused-arguments -msse2 -mfpmath=sse -arch i386" RANLIB=ranlib CXX="clang++ -Qunused-arguments -msse2 -mfpmath=sse -arch i386" AS=$CC AR=ar STRIP="strip -x -S" HOST_CC="clang -Qunused-arguments -msse2 -mfpmath=sse" AUTOCONF=/usr/local/Cellar/autoconf213/2.13/bin/autoconf213 HOST_CXX="clang++ -Qunused-arguments -msse2 -mfpmath=sse" sh /Users/skywalker/trees/mozilla-central/js/src/configure --target=i386-apple-darwin9.2.0 --enable-macos-target=10.5 --enable-debug --enable-optimize --enable-nspr-build --enable-more-deterministic --with-ccache --enable-gczeal --enable-debug-symbols --disable-tests

autoBisect is running.
I can't seem to get a good bisection result. Setting needinfo? from Luke as a start.
Flags: needinfo?(luke)
Odin produces the expression MAsmJSReturn(MBitAnd(1, MDiv(unsigned=true, 1, 0xffffffff))) and GVN replaces this with the constant 1.  Confirming this, toggling "--ion-gvn=on/off" changes the output when asm.js is enabled.
Flags: needinfo?(luke)
Constant folding isn't handling unsigned div or mod properly. It's doing a plain divide, so 1/0xffffffff is evaluated as 1/-1.
Assignee: nobody → sunfish
Constant folding of div and mod needs to be aware of the unsigned flag.
Attachment #8550442 - Flags: review?(nicolas.b.pierron)
Attachment #8550442 - Flags: review?(nicolas.b.pierron) → review+
https://hg.mozilla.org/mozilla-central/rev/a0171e579f20
Status: NEW → RESOLVED
Closed: 9 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: