Fix PR77862
gcc/testsuite/ChangeLog:
2016-10-06 Kugan Vivekanandarajah <kuganv@linaro.org>
PR tree-optimization/77862
* gcc.dg/pr77862.c: New test.
gcc/ChangeLog:
2016-10-06 Kugan Vivekanandarajah <kuganv@linaro.org>
PR tree-optimization/77862
* tree-vrp.c (add_equivalence): Use get_value_range so that
num_vr_values is checked before accessing vr_values.
From-SVN: r240842
+2016-10-06 Kugan Vivekanandarajah <kuganv@linaro.org>
+
+ PR tree-optimization/77862
+ * tree-vrp.c (add_equivalence): Use get_value_range so that
+ num_vr_values is checked before accessing vr_values.
+
2016-10-06 Kugan Vivekanandarajah <kuganv@linaro.org>
* tree-vrp.c (evrp_dom_walker::before_dom_children): Handle
+2016-10-06 Kugan Vivekanandarajah <kuganv@linaro.org>
+
+ PR tree-optimization/77862
+ * gcc.dg/pr77862.c: New test.
+
2016-10-06 Kugan Vivekanandarajah <kuganv@linaro.org>
* gcc.dg/tree-ssa/evrp4.c: New test.
--- /dev/null
+
+/* PR tree-optimization/77862 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fPIC -w" } */
+
+struct paramed_type
+{
+};
+int a;
+
+int memcmp ( int*, void *, long );
+
+void
+cur_token (void)
+{
+ if ( 1 != a || memcmp ( cur_token, "", a ) )
+ return;
+ struct paramed_type b = { };
+}
add_equivalence (bitmap *equiv, const_tree var)
{
unsigned ver = SSA_NAME_VERSION (var);
- value_range *vr = vr_value[ver];
+ value_range *vr = get_value_range (var);
if (*equiv == NULL)
*equiv = BITMAP_ALLOC (&vrp_equiv_obstack);