This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: rtl_loop_init vs try_redirect_by_replacing_jump vs simple jumps
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: stevenb dot gcc at gmail dot com (Steven Bosscher)
- Cc: dj at redhat dot com (DJ Delorie), gcc at gcc dot gnu dot org
- Date: Tue, 23 May 2006 17:46:31 -0400 (EDT)
- Subject: Re: rtl_loop_init vs try_redirect_by_replacing_jump vs simple jumps
>
> On 5/23/06, DJ Delorie <dj@redhat.com> wrote:
> >
> > > You're misunderstanding how this code works. In cfglayout mode,
> > > there is no "order" in the basic blocks such that
> > > BLOCK_FOR_INSN(NEXT_INSN(BB_END(BB)) ) == BB->next_bb. This means
> > > that you can fall through to other blocks than next_bb.
> >
> > Thanks for the tip, I figured out what was really happening. Which
> > leads to the next question: What's the right way to keep an asm() from
> > being loop invariant? I've got a case where an inline asm() is passed
> > a pointer (the pointer is invariant) but internally dereferences it
> > (the pointed-at memory is *not* invariant). However, loop-invariant.c
> > is pulling it out of the loop anyway.
>
> Sounds like you need a memory clobber constraint on the asm... ?
Or mark the memory as read like so:
asm ( "....." : .... : ... , "m" (*pointer) );
-- Pinski