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

--- Comment #19 from Paolo Bonzini <bonzini at gnu dot org> ---
LIVE provides live registers that MAY be initialized (are initialized on at
least one path).  The comments are all wrong!

There's no code in GCC for must-initialized.  Pierre's patch gets it right
(except that I'm not sure about the comment at line 2033).  The MIR name can
indeed add to the confusion about may/must.  Perhaps valid registers (VR)?

Note that this is not the available expressions problem.  The confluence
function is the same, but it operates on registers and not on expressions.  The
gen and kill sets are different, too.

I wouldn't be surprised if you don't find it in the literature, since it's a
relatively obvious extension of the usual dataflow problems.

I think this issue can also be fixed easily with an approximated solution,
which is already used for example by combine's
set_nonzero_bits_and_sign_copies.  If a register is undefined at the start of
the function, you punt because the register has uninitialized uses.  This is
suboptimal if you have cases like:

     int y, x;
     x = y;     /* uninitialized */
     ...
     y = 5;
     ...
     x = y;     /* initialized */

but they should be pretty rare.

Reply via email to