Hello Everyone,
    I am trying to add new RTL into the GCC 4.0.2 OpenRISC port and I am
trying to insert them into ccertain parts of the instruction stream. For
testing, I am trying to insert it in the start of every basic block.Here
is the code for what I am trying to do.
 
rtx newInsn = gen_rtx_MY_NEW_INSN(...);
rtx bbInsn;
 
FOR_EACH_BB(bb) {
   bbInsn = BB_HEAD(bb); 
   emit_insn_before(newInsn, bbInsn);
}
 
This code is working fine when we are having no optimization. But when I
have -O1, -O2 or -O3, the newInsn does'nt appear in every basic block.
It looks like the optimization phases is deleting this instruction. 
 
My question is, how can I "tell" GCC to never remove this instruction
(or RTL)? This instruction doesn't take any register values or write any
registers, just accepts an immediate field.

 
Any help is greatly appreciated!
 
Thanks,
 
Balaji V. Iyer.
 
 
-- 
 
Balaji V. Iyer
PhD Candidate, 
Center for Efficient, Scalable and Reliable Computing,
Department of Electrical and Computer Engineering,
North Carolina State University.


Reply via email to