This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/57287] [4.9 Regression] Bogus uninitialized warning with abnormal control flow


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57287

--- Comment #17 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to davidxl from comment #16)
> (In reply to Richard Biener from comment #15)
> > Confirmed.  David, can you have a look here?  I had a hard time following
> > what
> > exactly to do with the dataflow in the uninit pass for abnormal control flow
> > (abnormal control flow should be considered receiving an initialized value).
> > 
> > Thanks.
> 
> 
> I looked at it a little. The warning is not from the predicated uninit
> analysis which checks uses of phi defs.  The warning is emitted from
> tree-ssa.c:1644 in function warn_uninitialized_vars. It warns about the
> 'definitely' uninitialized variable that may be executed. In this case it is
> use of 'buf_16(ab)' in BB3.  Not sure where this statement comes from:
> 
> buf_24 = buf_16(ab);

Oh, sorry for not looking close enough again.  It is jump-threading introducing
this copy by duplicating a block with an abnormal PHI.

Not sure why it chooses to duplicate it - I see no jump threads registered
by DOM at -O1 - probably because:

  if (dump_file && (dump_flags & TDF_DETAILS)
      && e->dest != e2->src)
    fprintf (dump_file,
             "  Registering jump thread around one or more intermediate
blocks\n");

(gdb) p threaded_edges.vec_->vecdata_[0]->dest
$7 = <basic_block 0x7ffff6e1a4e0 (9)>
(gdb) p threaded_edges.vec_->vecdata_[1]->src
$8 = <basic_block 0x7ffff6e1a4e0 (9)>

but thats the jump threading it performs as it can optimize the if (!varseen)
check.

>From looking at the symptoms - warning about buf_16(D)(ab) use in

  buf_24 = buf_16(D)(ab);

it seems simplest to disregard SSA names occuring in abnormal PHIs ...


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]