Closed
Bug 1305816
Opened 8 years ago
Closed 8 years ago
fix clang bitfield warnings in Assembler-x86-shared.h
Categories
(Core :: JavaScript Engine: JIT, defect, P1)
Tracking
()
RESOLVED
FIXED
mozilla52
Tracking | Status | |
---|---|---|
firefox52 | --- | fixed |
People
(Reporter: froydnj, Assigned: froydnj)
Details
Attachments
(1 file, 1 obsolete file)
2.86 KB,
patch
|
jandem
:
review+
|
Details | Diff | Splinter Review |
clang-cl (built from recent svn HEAD) warns about initializing Operand::index_ with Registers::Invalid.
Comment hidden (mozreview-request) |
Comment 2•8 years ago
|
||
mozreview-review |
Comment on attachment 8795444 [details]
Bug 1305816 - explicitly specify underlying type of js::jit::X86Encoding::RegisterID;
https://reviewboard.mozilla.org/r/81482/#review80230
Attachment #8795444 -
Flags: review?(jdemooij) → review+
Updated•8 years ago
|
Priority: -- → P1
Comment 3•8 years ago
|
||
Try build failed:
jit/x86-shared/Assembler-x86-shared.h:62:33: error: 'js::jit::Operand::index_' is too small to hold all values of 'js::jit::Register::Encoding {aka enum js::jit::X86Encoding::RegisterID}
Seems like js::jit::Operand::index_ takes only 5 bits, instead of the 8 RegisterID can be with this patch.
Can you take a look Nathan?
Flags: needinfo?(nfroyd)
![]() |
Assignee | |
Comment 4•8 years ago
|
||
(In reply to Hannes Verschore [:h4writer] from comment #3)
> Try build failed:
> jit/x86-shared/Assembler-x86-shared.h:62:33: error:
> 'js::jit::Operand::index_' is too small to hold all values of
> 'js::jit::Register::Encoding {aka enum js::jit::X86Encoding::RegisterID}
>
> Seems like js::jit::Operand::index_ takes only 5 bits, instead of the 8
> RegisterID can be with this patch.
It's nonsensical that the compiler will warn about this for an 8-bit enum, but for a 32-bit enum (the default), it won't. :( This is because GCC actually computes tight bounds for the enum if it is a non-fixed enum, but doesn't do that for fixed enums. Sigh.
I don't have good ideas, other than making the underlying type conditional on MSVC (or maybe clang-cl). Jan, WDYT?
Flags: needinfo?(nfroyd) → needinfo?(jdemooij)
Comment 5•8 years ago
|
||
(In reply to Nathan Froyd [:froydnj] from comment #4)
> I don't have good ideas, other than making the underlying type conditional
> on MSVC (or maybe clang-cl). Jan, WDYT?
If this is the only case, I'd be fine with changing Operand::index_ from 5 bits to 8 to silence GCC. It seems like we have 15 bits of padding there, so it shouldn't affect sizeof(Operand).
Flags: needinfo?(jdemooij)
![]() |
Assignee | |
Comment 6•8 years ago
|
||
Might as well re-review, in case you have comments.
Attachment #8803022 -
Flags: review?(jdemooij)
![]() |
Assignee | |
Updated•8 years ago
|
Attachment #8795444 -
Attachment is obsolete: true
Comment 7•8 years ago
|
||
Comment on attachment 8803022 [details] [diff] [review]
explicitly specify underlying type of js::jit::X86Encoding::RegisterID
Review of attachment 8803022 [details] [diff] [review]:
-----------------------------------------------------------------
LGTM. If only we had uint5_t :)
Attachment #8803022 -
Flags: review?(jdemooij) → review+
Pushed by nfroyd@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/37cff35583fe
explicitly specify underlying type of js::jit::X86Encoding::RegisterID; r=jandem
Comment 9•8 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
You need to log in
before you can comment on or make changes to this bug.
Description
•