Reachable code discarded

Momchil Velikov velco@fadata.bg
Sun Jul 28 10:24:00 GMT 2002


>>>>> "Richard" == Richard Henderson <rth@redhat.com> writes:

Richard> On Fri, Jul 26, 2002 at 06:36:11PM +0300, Momchil Velikov wrote:
>> Consider the following x.c.09.cse. The ``(label_ref:SI 16)'' in insn
>> #48 constitutes an edge in the cfg ...

Richard> No it doesn't.  The presense of label_ref 16 in the jump table at
Richard> insn 54 constitutes the edge.

Ok. I wanted to say that when ``(label_ref 16)'' dissapears from insn
#54, the insn #52 will jump accross the old edge.

>> ``edge'' for it. Later, the jump from insn #52:#54 to insn #16 is
>> redirected to insn #64 and the basic block starting at insn #16 is
>> deleted.

Richard> Indeed.  This is not a bug in the optimizers, but a representational
Richard> problem in the backend.  What in the world are you trying to do with
Richard> that insn 48?

The ``(const (truncate ...))'' is produced by ``fold_rtx''. 

I'd think that the ``truncate'' is not correct in this case, since
``addr_diff_vec'' table contains offsets, which happen to fit in
smaller mode, as opposed to containing, e.g., low 16-bits of the
offsets. The ``truncate'' prevents folding expression like
 ``(plus (label_ref) (const (truncate (minus (label_ref) (label_ref)))))''

I've removed the truncate and this particular case no longer causes
problems.  I've bootstrapped and regtested (C,C++) on
i686-pc-linux-gnu and regtested on arm-unknown-elf (C, -marm/-mthumb)
with no regression.

~velco



More information about the Gcc mailing list