Hi all,

my intention is to add a pass at the Gimple (maybe SSA) level. The current problem is that I would like to generate code that saves the contents of the stack to a different memory location. Is there a way to access stack pointer and stack size (and the direction in which the stack is growing) on the tree level?

I already found STACK_SIZE and FRAME_ADDRESS on the RTL level, but would like to avoid adding an RTL pass.

The explanation why I want to save the stack contents is the following:
Code:

... use stack variables

__tm_atomic { /* begin transaction */

access shared locations in here

} /* may rollback */

In case of a rollback the original context of the thread must be restored so that it may execute the transaction again. This will be done using setjmp/longjmp. To prevent instrumenting all accesses to stack variables inside the transaction with STM runtime calls, the stack should be copied back from memory and the previous state of the stack variables is restored.

Any suggestions are helpful, thank you very much.

Regards,

Martin

Reply via email to