This is the mail archive of the gcc@gcc.gnu.org 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]

Re: Seeking suggestion


> From: Jim Wilson <wilson@codesourcery.com>
> To: Jamie Prescott <jpresss@yahoo.com>
> Cc: Georg-Johann Lay <avr@gjlay.de>; Ian Lance Taylor <iant@google.com>; gcc@gcc.gnu.org
> Sent: Tuesday, May 26, 2009 7:47:45 PM
> Subject: Re: Seeking suggestion
> 
> Jamie Prescott wrote:
> > Is there a reason why something like this would not work?
> >     if (!TARGET_XXX2)
> >       emit_clobber(gen_rtx_REG(CCmode, CC_REGNUM));
> >     emit_insn(gen_addsi3_nc(operands[0], operands[1], operands[2]));
> 
> Yes.  The optimizer will not know that addsi3_nc uses CC_REGNUM, as it is not 
> mentioned, so the optimizer will not know that these two RTL instructions always 
> need to remain next to each other.  Any optimization pass that moves insns 
> around may separate the add from the clobber resulting in broken code.  This is 
> what parallels are for, to make sure that the clobber and add stay together.

Thanks for the explanation. I somehow thought that every insn spit out by a define_insn
was automatically turned into a parallel.
I guess I was wrong.


- Jamie


      


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