Closed Bug 1756347 Opened 2 years ago Closed 2 years ago

AtomicsObject.cpp & AtomicOperations-shared-jit.cpp: In function '...' .. unsupported size for integer register

Categories

(Core :: JavaScript Engine: JIT, defect, P2)

Firefox 98
x86
Linux
defect

Tracking

()

RESOLVED FIXED
99 Branch
Tracking Status
firefox-esr91 --- unaffected
firefox97 --- unaffected
firefox98 --- wontfix
firefox99 --- fixed

People

(Reporter: ray-v, Assigned: jandem)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 files)

Cross compiling FF98 for i686 to changeset 8426c57c6960 [98_0b6_RELEASE] fails.
This failure first occurs when building to changeset 3fba20138922 [bug#1749665, part 3].

46:11.98 In file included from Unified_cpp_js_src0.cpp:11:
46:11.98 /mozbuild/mozilla/js/src/builtin/AtomicsObject.cpp: In function ‘bool atomics_store(JSContext*, unsigned int, JS::Value*)’:
46:11.98 /mozbuild/mozilla/js/src/builtin/AtomicsObject.cpp:387:1: error: unsupported size for integer register
46:11.98   387 | }
46:11.98       | ^
46:11.98 /mozbuild/beta/firefox-build-dir-i686/js/src/jit/AtomicOperationsGenerated.h: Assembler messages:
46:11.98 /mozbuild/beta/firefox-build-dir-i686/js/src/jit/AtomicOperationsGenerated.h:85: Error: bad register name `%sil'
46:14.65 gmake[4]: *** [/mozbuild/mozilla/config/rules.mk:660: Unified_cpp_js_src0.o] Error 1
46:14.65 gmake[3]: *** [/mozbuild/mozilla/config/recurse.mk:72: js/src/target-objects] Error 2


46:33.58 In file included from Unified_cpp_js_src_jit12.cpp:38:
46:33.58 /mozbuild/mozilla/js/src/jit/shared/AtomicOperations-shared-jit.cpp: In function ‘void js::jit::AtomicMemcpyDownUnsynchronized(uint8_t*, const uint8_t*, size_t)’:
46:33.58 /mozbuild/mozilla/js/src/jit/shared/AtomicOperations-shared-jit.cpp:122:1: error: unsupported size for integer register
46:33.58   122 | }
46:33.58       | ^
46:33.58 /mozbuild/mozilla/js/src/jit/shared/AtomicOperations-shared-jit.cpp:122:1: error: unsupported size for integer register
46:33.58 /mozbuild/mozilla/js/src/jit/shared/AtomicOperations-shared-jit.cpp:122:1: error: unsupported size for integer register
46:33.59 /mozbuild/mozilla/js/src/jit/shared/AtomicOperations-shared-jit.cpp:122:1: error: unsupported size for integer register
46:34.64 /mozbuild/beta/firefox-build-dir-i686/js/src/jit/AtomicOperationsGenerated.h: Assembler messages:
46:34.64 /mozbuild/beta/firefox-build-dir-i686/js/src/jit/AtomicOperationsGenerated.h:581: Error: bad register name `%bpl'
46:34.64 /mozbuild/beta/firefox-build-dir-i686/js/src/jit/AtomicOperationsGenerated.h:582: Error: bad register name `%bpl'
46:34.64 /mozbuild/beta/firefox-build-dir-i686/js/src/jit/AtomicOperationsGenerated.h:581: Error: bad register name `%dil'
46:34.64 /mozbuild/beta/firefox-build-dir-i686/js/src/jit/AtomicOperationsGenerated.h:582: Error: bad register name `%dil'
46:34.70 gmake[4]: *** [/mozbuild/mozilla/config/rules.mk:660: Unified_cpp_js_src_jit12.o] Error 1
...
47:19.53 gmake[3]: *** [/mozbuild/mozilla/config/recurse.mk:72: js/src/jit/target-objects] Error 2

Can you mention which compiler you are using? How did you configure Firefox (mozconfig file) ?

Firefox is currently being cross-compiled to x86 using clang-13 in our CI. I suspect there is a problem in the way you configure the cross compilation environment.

Flags: needinfo?(ray-v)

I use the build method here, which has worked up to this change.

The cross compiler is

# ./i686-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=./i686-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/mozbuild/chrt64/opt/cross-pi-gcc-x86/bin/../libexec/gcc/i686-linux-gnu/9.1.0/lto-wrapper
Target: i686-linux-gnu
Configured with: ../gcc-9.1.0/configure --prefix=/opt/cross-pi-gcc --with-sysroot=/opt/cross-pi-gcc/sysroot --target=i686-linux-gnu --enable-languages=c,c++,lto --enable-lto --with-arch=core2 --with-tune=core2 --with-fpmath=sse --disable-multilib
Thread model: posix
gcc version 9.1.0 (GCC)

The mozconfigs are for a native x86_64 build with additions for cross compiling [6].

x86_64 and aarch64 builds beyond this CS [3fba20138922] are ok.
I've just tried an armv7 build which fails at the same CS:

44:56.48 {standard input}: Assembler messages:
44:56.48 {standard input}:53: Error: immediate expression requires a # prefix -- `ldrb r3,[r1,0]'
44:56.48 {standard input}:54: Error: immediate expression requires a # prefix -- `strb r3,[r0,0]'
44:56.48 {standard input}:55: Error: immediate expression requires a # prefix -- `ldrb r3,[r1,1]'
44:56.48 {standard input}:56: Error: immediate expression requires a # prefix -- `strb r3,[r0,1]'
44:56.48 {standard input}:57: Error: immediate expression requires a # prefix -- `ldrb r3,[r1,2]'
44:56.48 {standard input}:58: Error: immediate expression requires a # prefix -- `strb r3,[r0,2]'
<snip> ..
44:56.78 {standard input}:5298: Error: immediate expression requires a # prefix -- `ldrb r2,[r5,0]'
44:56.78 {standard input}:5299: Error: immediate expression requires a # prefix -- `strb r2,[r4,0]'
45:00.11 gmake[4]: *** [/mozbuild/mozilla/config/rules.mk:658: Unified_cpp_js_src_jit14.o] Error 1
45:00.11 gmake[3]: *** [/mozbuild/mozilla/config/recurse.mk:72: js/src/jit/target-objects] Error 2
Flags: needinfo?(ray-v)

Inline assembly syntax depends on the compiler. I suspect that there is maybe a syntax which is not supported by gcc.

Blocks: 1732362
Severity: -- → S4
Flags: needinfo?(jdemooij)
Priority: -- → P2
Regressed by: 1749665

Set release status flags based on info from the regressing bug 1749665

Has Regression Range: --- → yes

This seems to be a GCC x86-32 issue when inlining the functions containing the inline assembly. I'll post a patch to add MOZ_NEVER_INLINE on 32-bit GCC as workaround.

Flags: needinfo?(jdemooij)

Use MOZ_NEVER_INLINE for GCC x86-32. It seems to run out of byte registers when
inlining these functions.

Assignee: nobody → jdemooij
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Pushed by jdemooij@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5348a5355b78
part 1 - Work around a GCC issue with generated atomics. r=lth
https://hg.mozilla.org/integration/autoland/rev/b4a2877a21d6
part 2 - Use # prefix for arm32 immediates. r=lth
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 99 Branch

It would have been nice to uplift to 98.

Regressions: 1792159
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: