This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

How to allocate memory safely in RTL, preferably on the stack? (relating to the RTL-level if-converter)

Dear all,

I have started working on adding more optimization ability to the RTL-level if-converter,
which is separate work from my recent work on a new GIMPLE-level if-converter.

Although these two projects are separate, the basic idea is the same:
to enable if-conversion of code that is presently not convertible due to the fact
that there may be e.g. a null pointer, by using the address of a scratchpad
as the address for the load/store when the condition in the "if" is false.

In order to be able to implement this idea for stores, I think I need to make some changes
to the RTL if-converter such that it will sometimes add -- to the code being compiled --
a new slot/variable in the stack frame.  This memory needs to be addressable via a pointer
in the code being generated, so AFAIK just allocating a new pseudo-register won`t work
and AFAIK using an RTL "scratch" register also won`t work.  I also want to do my best to
ensure that this memory is thread-local.  For those reasons, I`m asking about the stack.

If anybody reading this would help me to understand how to allocate
memory safely at the RTL level, I`d appreciate it very much.

Of course, if I`m on the wrong track entirely, I`d also appreciate feedback about that.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]