Closed
Bug 450765
Opened 17 years ago
Closed 17 years ago
Fix type-punned warnings in LIR.h
Categories
(Tamarin Graveyard :: Tracing Virtual Machine, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: mrbkap, Assigned: mrbkap)
References
Details
Attachments
(1 file)
1.43 KB,
patch
|
edwsmith
:
review+
|
Details | Diff | Splinter Review |
When compiling nanojit, I see lots of:
nanojit/LIR.h: In member function ‘uint64_t nanojit::LIns::constvalq() const’:
nanojit/LIR.h:281: warning: dereferencing type-punned pointer will break strict-aliasing rules
nanojit/LIR.h: In member function ‘double nanojit::LIns::constvalf() const’:
nanojit/LIR.h:305: warning: dereferencing type-punned pointer will break strict-aliasing rules
AFAICT, the warnings are real and easy to fix.
Attachment #333960 -
Flags: review?(edwsmith)
Assignee | ||
Comment 1•17 years ago
|
||
Note: due to time pressure, I've checked this patch into the tracemonkey tree as http://hg.mozilla.org/tracemonkey/index.cgi/rev/84b79f7695c2
Comment 2•17 years ago
|
||
That change probably needs to be endian-specific.
Assignee | ||
Comment 3•17 years ago
|
||
Only the second hunk needs to be, right? The first bit is basically performing a memcpy.
Comment 4•17 years ago
|
||
depends on how the values are inserted into the LIR stream in the first place -- if we're always pulling them out in the same order as we put them in, it probably doesn't matter... but it's probably good form to always store them in platform order
Assignee | ||
Comment 5•17 years ago
|
||
Wait, I lost it. There's no endian difference between the new code and old code here. The cast and union have exactly the same semantics, except the union tells the compiler which names refer to which memory so it doesn't over optimize. If the new code needs to be endian specific, so does the old code.
Comment 6•17 years ago
|
||
True. Maybe it didn't matter before because we were always shoving them in, and pulling them out, in the same order? Or maybe we just hadn't tested on a big-endian machine?
Assignee | ||
Comment 7•17 years ago
|
||
I don't know what this code has been tested on, but it's true that it didn't matter before because you're just shoving them in and pulling them out. I don't know enough of nanojit's internals to know how we get here in the first place.
Updated•17 years ago
|
Attachment #333960 -
Flags: review?(edwsmith) → review+
Comment 8•17 years ago
|
||
Comment on attachment 333960 [details] [diff] [review]
Fix
Contact rreitmai@adobe.com if you need someone to push this once/if it's updated to TT tip. thanks.
Assignee | ||
Comment 9•17 years ago
|
||
Assignee | ||
Updated•17 years ago
|
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•