Error while using LOG_LINKS information.

Dave Korn dk@artimi.com
Tue Apr 27 18:48:00 GMT 2004


> -----Original Message-----
> From: gcc-owner On Behalf Of kernel_learner
> Sent: 27 April 2004 17:35

> Hi all,
> 
>  IN a machine-dependent-reorg pass that I am writing I
> wrote a simple piece of code which traverses the
> LOG_LINKS:
> 
> for(;insns;insns=NEXT_INSN(insns))
> {
>    for(link = LOG_LINKS (insns); link; link =
> XEXP(link, 1));
> }
> This gives me a problem while building gcc:
> 
> make[2]: *** [libgcc/./_muldi3.o] Error 1
> make[2]: Leaving directory
> `/home/SOK_STUFF/or1k/b-gcc/gcc'
> make[1]: *** [libgcc.a] Error 2
> make[1]: Leaving directory
> `/home/SOK_STUFF/or1k/b-gcc/gcc'
> make: *** [all-gcc] Error 2
> 
> I am sure that the problem is cause by this code since
> if I take it away it builds PERFECT!
> 
> Is the LOG_LINKS information corrupted or invalid at
> the machine dependent reorganization part. Or am I
> traversing it wrong?

  From my reading of the docs, LOG_LINKS (insn) is only valid if the insn is
of type insn, call_insn or jump_insn.  You should make sure in your outer
loop that insn is of one of those types before the inner loop is allowed to
run, otherwise you might be applying LOG_LINKS to a code_label, barrier or
note.

  Or it could be some kind of corruption, if that doesn't fix it.


    cheers, 
      DaveK
-- 
Can't think of a witty .sigline today....



More information about the Gcc mailing list