On Wed, Sep 05, 2018 at 12:55:55PM +0200, Richard Biener wrote:
> 
> The following makes sure to call the default CTOR when emplacing a
> vec<> in the avail hash-map.  Certainly the intent was to zero-initialize
> the m_vec member.

Guess it would be nice to see what older versions of system g++ do with
that.
At least from what I remember last time, value-initialization vs.
zero-initialization vs. no initialization in C++ is heavily dependent on
compiler version and -std=c++NN version, there have been many bugs in the
past and changes between standard versions.

> 2018-09-05  Richard Biener  <rguent...@suse.de>
> 
>       PR bootstrap/87134
>       * tree-ssa-sccvn.c (rpo_elim::eliminate_push_avail): Make sure
>       to zero-init the emplaced vec.
> 
> Index: gcc/tree-ssa-sccvn.c
> ===================================================================
> --- gcc/tree-ssa-sccvn.c      (revision 264123)
> +++ gcc/tree-ssa-sccvn.c      (working copy)
> @@ -5798,7 +5798,7 @@ rpo_elim::eliminate_push_avail (basic_bl
>    vec<std::pair<int, int> > &av = m_rpo_avail.get_or_insert (valnum, 
> &existed);
>    if (!existed)
>      {
> -      new (&av) vec<std::pair<int, int> >;
> +      new (&av) vec<std::pair<int, int> >();
>        av.reserve_exact (2);
>      }
>    av.safe_push (std::make_pair (bb->index, SSA_NAME_VERSION (leader)));

        Jakub

Reply via email to