Do not use tree_to_wide_ref that point to a temporary (PR c++/90587).
authorMartin Liska <mliska@suse.cz>
Thu, 23 May 2019 12:07:09 +0000 (14:07 +0200)
committerMartin Liska <marxin@gcc.gnu.org>
Thu, 23 May 2019 12:07:09 +0000 (12:07 +0000)
2019-05-23  Martin Liska  <mliska@suse.cz>

PR c++/90587
* tree-ssa-uninit.c (value_sat_pred_p): The result of &
operation points to a temporary (pointed via tree_to_wide_ref)
that is out of scope after the &.

From-SVN: r271555

gcc/ChangeLog
gcc/tree-ssa-uninit.c

index ba549f754e228b2ca6516fa1f25d0cfbb98d83c6..5b12af809abd3b617dbe1f942c16f7286313d216 100644 (file)
@@ -1,3 +1,10 @@
+2019-05-23  Martin Liska  <mliska@suse.cz>
+
+       PR c++/90587
+       * tree-ssa-uninit.c (value_sat_pred_p): The result of &
+       operation points to a temporary (pointed via tree_to_wide_ref)
+       that is out of scope after the &.
+
 2019-05-23  Jonathan Wakely  <jwakely@redhat.com>
 
        PR c++/90592
index bc07afe32c85e7c5a33625ce1f89a71231e1ba16..fe8f8f0bc28f022c408f624ddb80d1b4cc2d2112 100644 (file)
@@ -1058,7 +1058,7 @@ value_sat_pred_p (tree val, tree boundary, enum tree_code cmpc,
   if (cmpc != BIT_AND_EXPR)
     return is_value_included_in (val, boundary, cmpc);
 
-  wi::tree_to_wide_ref andw = wi::to_wide (val) & wi::to_wide (boundary);
+  wide_int andw = wi::to_wide (val) & wi::to_wide (boundary);
   if (exact_p)
     return andw == wi::to_wide (val);
   else