diff --git a/gcc/ipa-cp.cc b/gcc/ipa-cp.cc
index 9ec86d77992..a5b45a8e6b9 100644
--- a/gcc/ipa-cp.cc
+++ b/gcc/ipa-cp.cc
@@ -1963,9 +1963,11 @@ ipa_value_range_from_jfunc (ipa_node_params *info, cgraph_edge *cs,
 	{
 	  value_range op_res, res;
 	  tree op = ipa_get_jf_pass_through_operand (jfunc);
-	  value_range op_vr (op, op);
+	  value_range op_vr;
 	  range_op_handler handler (operation, vr_type);
 
+	  ipa_range_set_and_normalize (op_vr, op);
+
 	  if (!handler
 	      || !op_res.supports_type_p (vr_type)
 	      || !handler.fold_range (op_res, vr_type, srcvr, op_vr))
@@ -2757,10 +2759,12 @@ propagate_vr_across_jump_function (cgraph_edge *cs, ipa_jump_func *jfunc,
       else if (!ipa_edge_within_scc (cs))
 	{
 	  tree op = ipa_get_jf_pass_through_operand (jfunc);
-	  value_range op_vr (op, op);
+	  value_range op_vr;
 	  value_range op_res,res;
 	  range_op_handler handler (operation, operand_type);
 
+	  ipa_range_set_and_normalize (op_vr, op);
+
 	  if (!handler
 	      || !op_res.supports_type_p (operand_type)
 	      || !handler.fold_range (op_res, operand_type,
diff --git a/gcc/ipa-fnsummary.cc b/gcc/ipa-fnsummary.cc
index 48093a8b623..b328bb8ce14 100644
--- a/gcc/ipa-fnsummary.cc
+++ b/gcc/ipa-fnsummary.cc
@@ -500,9 +500,11 @@ evaluate_conditions_for_known_args (struct cgraph_node *node,
 		    }
 		  else if (!op->val[1])
 		    {
-		      value_range op0 (op->val[0], op->val[0]);
+		      value_range op0;
 		      range_op_handler handler (op->code, op->type);
 
+		      ipa_range_set_and_normalize (op0, op->val[0]);
+
 		      if (!handler
 			  || !res.supports_type_p (op->type)
 			  || !handler.fold_range (res, op->type,
@@ -518,12 +520,10 @@ evaluate_conditions_for_known_args (struct cgraph_node *node,
 		{
 		  value_range res;
 		  value_range val_vr;
-		  if (TREE_CODE (c->val) == INTEGER_CST)
-		    val_vr.set (c->val, c->val);
-		  else
-		    val_vr.set_varying (TREE_TYPE (c->val));
 		  range_op_handler handler (c->code, boolean_type_node);
 
+		  ipa_range_set_and_normalize (val_vr, c->val);
+
 		  if (!handler
 		      || !res.supports_type_p (boolean_type_node)
 		      || !handler.fold_range (res, boolean_type_node, vr, val_vr))
diff --git a/gcc/ipa-prop.h b/gcc/ipa-prop.h
index 7eb5c8f44ea..93785a6a8e6 100644
--- a/gcc/ipa-prop.h
+++ b/gcc/ipa-prop.h
@@ -1201,4 +1201,18 @@ tree build_ref_for_offset (location_t, tree, poly_int64, bool, tree,
 /* In ipa-cp.cc  */
 void ipa_cp_cc_finalize (void);
 
+/* Set R to the range of [VAL, VAL] while normalizing addresses to
+   non-zero.  */
+
+inline void
+ipa_range_set_and_normalize (irange &r, tree val)
+{
+  if (TREE_CODE (val) == INTEGER_CST)
+    r.set (val, val);
+  else if (TREE_CODE (val) == ADDR_EXPR)
+    r.set_nonzero (TREE_TYPE (val));
+  else
+    r.set_varying (TREE_TYPE (val));
+}
+
 #endif /* IPA_PROP_H */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr109639.c b/gcc/testsuite/gcc.dg/tree-ssa/pr109639.c
new file mode 100644
index 00000000000..897e62cfad6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr109639.c
@@ -0,0 +1,20 @@
+// { dg-do compile }
+// { dg-options "-O2" }
+
+extern int k[];
+int m;
+int* j();
+void f(int *howto) {
+  short __trans_tmp_1;
+  long offset = howto - k;
+  __trans_tmp_1 = offset;
+  for (;;) {
+    if (howto == 0)
+      return;
+    if (__trans_tmp_1) {
+      howto = j();
+      m = *howto;
+    }
+    f(howto);
+  }
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr109643.c b/gcc/testsuite/gcc.dg/tree-ssa/pr109643.c
new file mode 100644
index 00000000000..2bd6f25e9ef
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr109643.c
@@ -0,0 +1,18 @@
+// { dg-do compile }
+// { dg-options "-O2" }
+
+int g_variant_type_info_basic_table[1];
+int g_variant_type_info_check__g_boolean_var_, g_variant_type_info_get_index;
+int *g_variant_type_info_get_info;
+int g_assertion_message_expr();
+void g_variant_type_info_check(int *info) {
+  int index = info - g_variant_type_info_basic_table;
+  if (index)
+    g_variant_type_info_check__g_boolean_var_ = 1;
+  g_assertion_message_expr();
+}
+void g_variant_type_info_get() {
+  g_variant_type_info_get_info =
+      g_variant_type_info_basic_table + g_variant_type_info_get_index;
+  g_variant_type_info_check(g_variant_type_info_get_info);
+}
diff --git a/gcc/value-range.cc b/gcc/value-range.cc
index 1a3013be6fd..c11c3f58d2c 100644
--- a/gcc/value-range.cc
+++ b/gcc/value-range.cc
@@ -1074,6 +1074,9 @@ irange::set (tree min, tree max, value_range_kind kind)
       return;
     }
 
+  gcc_checking_assert (TREE_CODE (min) == INTEGER_CST);
+  gcc_checking_assert (TREE_CODE (max) == INTEGER_CST);
+
   if (TREE_OVERFLOW_P (min))
     min = drop_tree_overflow (min);
   if (TREE_OVERFLOW_P (max))
