CodegenLIR.cpp generates "cast to pointer from integer of different size" errors with GCC 4.6



8 years ago
3 months ago


(Reporter: aaw, Assigned: aaw)


Q1 12 - Brannan
Bug Flags:
flashplayer-injection -
flashplayer-qrb +



(2 attachments)



8 years ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_5_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.220 Safari/535.1

Steps to reproduce:

I compiled tamarin on a Linux x86_64 machine with GCC 4.6 and -Wno-unused-but-set-variable -fno-strict-aliasing (needed to get rid of other common errors).

Actual results:

The build failed with:

/home/aaw/src/tamarin-central/core/CodegenLIR.cpp: In member function 'nanojit::LIns* avmplus::CodegenLIR::leaIns(int32_t, nanojit::LIns*)':
/home/aaw/src/tamarin-central/core/CodegenLIR.cpp:406:64: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
/home/aaw/src/tamarin-central/core/CodegenLIR.cpp: In member function 'virtual void avmplus::CodegenLIR::writeBlockStart(avmplus::FrameState*)':
/home/aaw/src/tamarin-central/core/CodegenLIR.cpp:1680:47: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
/home/aaw/src/tamarin-central/core/CodegenLIR.cpp: In member function 'void avmplus::CodegenLIR::emitPrep(avmplus::FrameState*)':
/home/aaw/src/tamarin-central/core/CodegenLIR.cpp:2893:43: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
cc1plus: all warnings being treated as errors

Expected results:

It should compile.  I believe the attached patch fixes this, but it would be good to have someone more familiar with this code take a look.

Comment 1

8 years ago
Created attachment 559387 [details] [diff] [review]
proposed fix


8 years ago
Component: Library → Virtual Machine
OS: All → Linux
QA Contact: library → vm
Hardware: All → x86_64

Comment 2

8 years ago
Comment on attachment 559387 [details] [diff] [review]
proposed fix

Thanks for the patch!

Instructions like LIR_addp and LIR_stp require pointer-sized operands, and InsConst() always generates a 32-bit int constant.  Those call sites do intend to upcast the int to a pointer-sized int (int->intptr_t) then re-use InsConstPtr, so a better fix would be (e.g.)


And so on for the other error sites.  If you can add a comment while you're in there that would be great too.
Attachment #559387 - Flags: review-


8 years ago
Assignee: nobody → aaw
Flags: flashplayer-qrb+
Flags: flashplayer-injection-
Priority: -- → P3
Target Milestone: --- → Q1 12 - Brannan

Comment 3

8 years ago
Created attachment 559890 [details] [diff] [review]
New patch.

Updated patch attached.  Note that I don't have write access to the repository, so someone will have to apply this for me.


8 years ago
Attachment #559890 - Flags: review?(edwsmith)


8 years ago
Attachment #559890 - Flags: review?(edwsmith) → review+

Comment 4

8 years ago
This patch does not apply cleanly to tamarin-redux, in fact the code in TR looks nothing like what this patch says it looks like.  Which version of tamarin, and which changeset, is this based on?  The changeset in the patch (fbecf6c8a86f) does not seem to exist in tamarin-redux.

Comment 5

8 years ago
This was generated against the code in tamarin-central.

Comment 6

8 years ago
Ollie, can you rebase the patch to be based on the tamarin-redux baseline.  TR is the developmental baseline.
Blocks: 753029
Tamarin is a dead project now. Mass WONTFIX.
Last Resolved: 3 months ago
Resolution: --- → WONTFIX
Tamarin isn't maintained anymore. WONTFIX remaining bugs.
You need to log in before you can comment on or make changes to this bug.