[PATCH] Add "Implicit sets" to GCSE's cprop (take 2)

Roger Sayle roger@www.eyesopen.com
Sun Feb 2 02:39:00 GMT 2003


Hi Richard,
> I don't have any more time this afternoon, so I thought I'd
> brain dump here before I go.

Sorry for the inconvenience.  My GCSE patches have a habit of
revealing latent bugs in the rest of the compiler, probably from
the dramatic control flow changes to the CFG.

I'll see what I can do about reproducing the problem on an alpha.
Unfortunately, mainline CVS didn't build on alphaev67-dec-osf5.1
as of yesterday due to mips-tfile problems associated with
crtfastmath.   Prior to that Tru64 didn't even get past config.guess


However I think I've figured it out from you "brain dump"...

> +Implicit set of reg 82 in basic block 384
>
> +Index 114 (hash value 82)
>    (set (reg/v:DI 82 [ swapped ])
>      (const_int 0 [0x0]))
>
> +GLOBAL CONST-PROP: Replacing reg 82 in insn 3987 with (const_int 0 [0x0])
> 	bb 393
>
> +GLOBAL CONST-PROP: Replacing reg 82 in insn 4092 with (const_int 0 [0x0])
> 	bb 398
>
> +GLOBAL CONST-PROP: Replacing reg 82 in insn 4123 with (const_int 0 [0x0])
>
> Basic block 383: first insn 9473, last 4126, prev 382, next 384, loop_depth 0, c
> ount 0, freq 0.
> Predecessors:  382 (fallthru)
> Successors:  384 (fallthru) 390
> Registers live at start: (nil)
> Registers live at end: (nil)
> Invalid sum of outgoing probabilities 0.0%
>
> Basic block 384: first insn 9474, last 10030, prev 383, next 385, loop_depth 0,
> count 0, freq 0.
> Predecessors:  383 (fallthru)
> Successors:  389 385 (fallthru)
> Registers live at start: (nil)
> Registers live at end: (nil)
> Invalid sum of outgoing probabilities 0.0%
>
> Now, the part that really seems wrong is that block 383 ends with
>
> (jump_insn 3834 3833 3837 383 0x20000b1b290 (set (pc)
>         (if_then_else (eq (reg:DI 2131)
>                 (const_int 0 [0x0]))
>             (label_ref 3852)
>             (pc))) 174 {*bcc_normal} (nil)
>     (nil))
>
> I can't find register 82 mentioned at all.  The only thing I can
> think is that somehow the block indicies are messed up between
> find_implicit_sets and compute_hash_table_work, and I can't think
> how that might happen.


It might just be a remarkable co-incidence but...

You're looking for a reference to (reg:DI 82) but the place that
should contain this register RTL actually mentions (reg:DI 2131).
Have you noticed that 2131 % 256 = 83?

Might it be worthwhile ruling out truncation and off-by-one?

Roger
--



More information about the Gcc-patches mailing list