This is the mail archive of the gcc-patches@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]

[PATCH] Maybe fix PR87134


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.

It looks like some versions of clang do not agree that vec<> is POD
so that might also help the reported FreeBSD issue.

Bootstrap running on x86_64-unknown-linux-gnu, will apply shortly.

Richard.

2018-09-05  Richard Biener  <rguenther@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)));


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