This is the mail archive of the
mailing list for the GCC project.
Replace all stack pointer with frame pointer in rtl level
- From: "Lu, Kangjie" <kjlu at gatech dot edu>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 27 Jan 2015 17:52:47 -0500 (EST)
- Subject: Replace all stack pointer with frame pointer in rtl level
- Authentication-results: sourceware.org; auth=none
I am a beginner of gcc.
My goal of modifying gcc is to maintain two stacks.
One is accessed by rbp, the other is accessed by rsp.
rsp is only used by call/ret. All other accesses (e.g., access parameters, access local variables)
to stack are via rbp.
For easy implementation, I would use flags "-fomit-frame-pointer -ffixed-rbp" to
compile the target program, which prevents gcc using rbp. And in the RTL level,
I will replace all rsp with rbp (I may also change push/pop into mov instructions).
My question is how to iterate all registers used in insns in rtl level, and replace all
rsp with rbp.