Closed
Bug 1477742
Opened 7 years ago
Closed 7 years ago
Silence a -Wtautological-constant-compare in MacroAssembler.cpp
Categories
(Core :: JavaScript Engine: JIT, defect)
Core
JavaScript Engine: JIT
Tracking
()
RESOLVED
FIXED
mozilla63
| Tracking | Status | |
|---|---|---|
| firefox63 | --- | fixed |
People
(Reporter: away, Assigned: sfink)
References
Details
Attachments
(1 file)
|
3.38 KB,
patch
|
jandem
:
review+
|
Details | Diff | Splinter Review |
13:55:42 INFO - z:/build/build/src/js/src/jit/MacroAssembler.cpp(1064,19): error: comparison 'intptr_t' (aka 'int') < -2147483648 is always false [-Werror,-Wtautological-constant-compare]
13:55:42 INFO - if (maxOffset < (1 << 31)) {
13:55:42 INFO - ~~~~~~~~~ ^ ~~~~~~~~~
13:55:42 INFO - 1 error generated.
clang-cl currently has -Werror disabled due to too much noise. Cleanup is ongoing, but Spidermonkey is already -Werror clean except for this one issue.
Most clang-cl builds don't mind the above code because this diagnostic was split up into off-by-default parts in https://github.com/llvm-mirror/clang/commit/b5b3d436a1831ddb4fdf2e4c9c07fb60807b70e5.
But our static analysis builders are stuck on an old version of clang, so they still complain.
Well, I tried to cheat my way out of this by writing `1u << 31`, which trades the -Wtautological-constant-compare for a -Wsign-compare, which is disabled in our clang-cl builds, but the Android builders won't let me get away with it.
sfink, have any better ideas?
| Assignee | ||
Comment 2•7 years ago
|
||
(In reply to David Major [:dmajor] from comment #1)
> sfink, have any better ideas?
Yes. Rip out my code. The minor optimization isn't worth the complexity. Maybe if we did it in a more general way (eg statically track the contents of various registers to see if there's a nearby pointer that we could use), but a special case for a small piece of code (that isn't even enabled by default) is mostly pointless.
| Assignee | ||
Comment 3•7 years ago
|
||
jandem, sending review to you since we've discussed this in the past (I think you even suggested doing this.) Thanks!
Attachment #8994252 -
Flags: review?(jdemooij)
| Assignee | ||
Updated•7 years ago
|
Assignee: nobody → sphink
Status: NEW → ASSIGNED
Comment 4•7 years ago
|
||
Comment on attachment 8994252 [details] [diff] [review]
Remove dubious pointer computation optimization
Review of attachment 8994252 [details] [diff] [review]:
-----------------------------------------------------------------
I agree this makes sense.
Attachment #8994252 -
Flags: review?(jdemooij) → review+
Pushed by sfink@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/721e491ecd01
Remove dubious pointer computation optimization, r=jandem
Comment 7•7 years ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox63:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in
before you can comment on or make changes to this bug.
Description
•