Closed Bug 531888 Opened 15 years ago Closed 13 years ago

Overzealous compilers don't like Assembler::intersectRegisterState

Categories

(Core Graveyard :: Nanojit, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Future

People

(Reporter: stejohns, Unassigned)

Details

(Whiteboard: fixed-in-nanojit, fixed-in-tracemonkey, fixed-in-tamarin)

Attachments

(1 file)

This funtion contains the statement

        for (Register r=LastReg; 
             r >= FirstReg && r <= LastReg;
             r = prevreg(r))

which generates

    error: comparison is always true due to limited range of data type

on current android versions of gcc, causing spurious build failures.
I guess we could put NanoAssert(r <= LastReg); in the body and remove the condition from the check.
Attached patch PatchSplinter Review
One possible patch (fixes it). Open for more elegant solutions.
Attachment #415184 - Flags: review?(rreitmai)
Comment on attachment 415184 [details] [diff] [review]
Patch

Fix looks fine (albeit ugly), but do we know the source of the warning?  Can we just tweak the comparison(s) and add any appropriate asserts.
Attachment #415184 - Flags: review?(rreitmai) → review+
(In reply to comment #3)
> (From update of attachment 415184 [details] [diff] [review])
> Fix looks fine (albeit ugly), but do we know the source of the warning?  Can we
> just tweak the comparison(s) and add any appropriate asserts.

Source is that Register can't (legally) ever be outside that range; prevreg/nextreg hack things to make that possible, but the compiler can't tell that.

Should I get a mozillan to review this too?
I see and yes having Nick look at it would be worthwhile.  

I'd prefer not to push this change (maybe I should have marked it '-'?) unless we are truly forced.
Comment on attachment 415184 [details] [diff] [review]
Patch

Adding Nick (or do you prefer Nicholas?) ... it's an ugly fix I'm not particularly happy with, so I'm open for better suggestions.
Attachment #415184 - Flags: review?(nnethercote)
Comment on attachment 415184 [details] [diff] [review]
Patch

"Nick" is fine.

This is ugly but at least it has a comment.  Although I'd appreciate a capital letter at the start of the comment and a full stop at the end :)
Attachment #415184 - Flags: review?(nnethercote) → review+
Pretty sure that this has been pushed to all relevant repos, shall we close it?
Component: JIT Compiler (NanoJIT) → Nanojit
Product: Tamarin → Core
QA Contact: nanojit → nanojit
Target Milestone: --- → Future
OS: Android → All
Hardware: ARM → All
Whiteboard: fixed-in-nanojit, fixed-in-tracemonkey, fixed-in-tamarin
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: