https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66790

--- Comment #29 from Paolo Bonzini <bonzini at gnu dot org> ---
> While getting familiar with DF problems, I noticed that LIVE's ignores
> the order of GENs and KILLs in basic blocks. In other words, the
> transfer function for: GEN(r1); KILL(r1) is currently the same as for
> KILL(r1); GEN(r1) whereas clearly the former leaves r1 unitialized
> whereas the latter leaves it initialized.

GEN and KILL are not the same for LR and MIR.

1) Sets and clobbers are handled differently.  A set or clobber of r1 _kills_
liveness, while for MIR sets _generate_ "initialized-ness" and only clobbers
kill it.

2) A use of r1 _creates_ liveness (which extends up, until it reaches the sets
for all reaching definitions of that use), while uses of r1 are irrelevant for
MIR.

3) For LR, GEN must override KILL if an insn has both a set and a use of r1. 
For MIR, you cannot have a GEN (set) and a KILL (clobber) in the same insn.

BTW, are you sure that

+      if (DF_REF_FLAGS_IS_SET (def,
+                              DF_REF_PARTIAL | DF_REF_CONDITIONAL))
+       /* All partial or conditional def
+          seen are included in the gen set. */
+       bitmap_set_bit (gen, regno);

?  I would have thought they don't belong in any set, and on the contrary I
would have thought that may-clobber definitions count as kills.

Reply via email to