Some more information on what I have so far. I’ll actually focus on the longjmp side, as the problem is probably easier.
I need to get the SETHI / OR combination inserted where the comment
“*** Need to use the SETHI / OR combination here. ***” appears in the
code below, but I’m not sure that this is done anywhere near this piece
of code, so I’ll include all the relevant parts that I can find of my
I don’t understand what exactly you want to materialize here. Shouldn’t
the address of the buffer already be an operand at this point?
Quite possibly, I’ve over-simplified my example. Perhaps I should have focussed more on the setjmp part, which is actually where I was coding anyway. In this, I need to store the address of the instruction after I’ve lowered the intrinsic into a buffer so that I can recover this and jump back to it from the longjmp intrinsic.
There are two or three parts, and I’m not sure how to go about either. After I get these working, the rest is (I think) plain-sailing:
(1) I need to take the address of the instruction after the lowered setjmp intrinsic, which I think requires that I create a new basic block
(2) I need to get the address of this basic block, at lowering time, and get it into a register using the SETHI / OR combination (I presume). Once it’s in the register, I can store it in the buffer easily. There must surely be a good way to load an address using SETHI / OR, but nothing I’ve tried (including “makeAddress”) works so far. I guess I could code each of SETHI and OR individually, but surely there’s some code around to take care of this already.
(3) Is there anything else? Do I need any indicators to let the back-end know it’ll need to fix-up the address taken in step (2) later in the compilation - or possibly in the link - pipeline?