@@ -1,3 +1,9 @@
+2017-12-18 Jeff Law <law@redhat.com>
+
+ PR tree-optimization/83477
+ * tree-ssa-threadedge.c (record_temporary_equivalences_from_phis): For
+ a non-virtual PHI, always push a new range.
+
2017-12-19 Martin Sebor <msebor@redhat.com>
PR middle-end/77608
@@ -195,7 +201,6 @@
* tree-ssa-dom.c (record_equivalences_from_phis): Fix handling
of degenerates resulting from ignoring an edge.
->>>>>>> .r255835
2017-12-18 Martin Sebor <msebor@redhat.com>
PR middle-end/83373
@@ -1,3 +1,8 @@
+2017-12-18 Jeff Law <law@redhat.com>
+
+ PR tree-optimization/83477
+ * gcc.c-torture/execute/pr83477.c: New test.
+
2017-12-19 Martin Sebor <msebor@redhat.com>
PR middle-end/77608
@@ -63,7 +68,6 @@
PR ipa/83346
* g++.dg/ipa/pr82801.C: New test.
->>>>>>> .r255835
2017-12-18 Martin Sebor <msebor@redhat.com>
PR middle-end/83373
new file mode 100644
@@ -0,0 +1,22 @@
+int yf = 0;
+
+void
+pl (int q5, int nd)
+{
+ unsigned int hp = q5;
+ int zx = (q5 == 0) ? hp : (hp / q5);
+
+ yf = ((nd < 2) * zx != 0) ? nd : 0;
+}
+
+int
+main (void)
+{
+ pl (1, !yf);
+ if (yf != 1)
+ __builtin_abort ();
+
+ return 0;
+}
+
+
@@ -156,11 +156,37 @@ record_temporary_equivalences_from_phis (edge e,
const_and_copies->record_const_or_copy (dst, src);
/* Also update the value range associated with DST, using
- the range from SRC. */
- if (evrp_range_analyzer && TREE_CODE (src) == SSA_NAME)
+ the range from SRC.
+
+ Note that even if SRC is a constant we need to set a suitable
+ output range so that VR_UNDEFINED ranges do not leak through. */
+ if (evrp_range_analyzer)
{
- value_range *vr = evrp_range_analyzer->get_value_range (src);
- evrp_range_analyzer->push_value_range (dst, vr);
+ /* Get an empty new VR we can pass to update_value_range and save
+ away in the VR stack. */
+ vr_values *vr_values = evrp_range_analyzer->get_vr_values ();
+ value_range *new_vr = vr_values->allocate_value_range ();
+ memset (new_vr, 0, sizeof (value_range));
+
+ /* There are three cases to consider:
+
+ First if SRC is an SSA_NAME, then we can copy the value
+ range from SRC into NEW_VR.
+
+ Second if SRC is an INTEGER_CST, then we can just wet
+ NEW_VR to a singleton range.
+
+ Otherwise set NEW_VR to varying. This may be overly
+ conservative. */
+ if (TREE_CODE (src) == SSA_NAME)
+ copy_value_range (new_vr, vr_values->get_value_range (src));
+ else if (TREE_CODE (src) == INTEGER_CST)
+ set_value_range_to_value (new_vr, src, NULL);
+ else
+ set_value_range_to_varying (new_vr);
+
+ /* This is a temporary range for DST, so push it. */
+ evrp_range_analyzer->push_value_range (dst, new_vr);
}
}
return true;