Commit f824e18c by Aldy Hernandez Committed by Aldy Hernandez

tree-vrp.c (value_range_base::dump): Dump type.

	* tree-vrp.c (value_range_base::dump): Dump type.
	Do not use INF nomenclature for 1-bit types.
	(dump_value_range): Group all variants to common dumping code.
	(debug): New overloaded functions for value_ranges.
	(value_range_base::dump): Remove no argument version.
	(value_range::dump): Same.

testsuite/
	* gcc.dg/tree-ssa/pr64130.c: Adjust for new value_range pretty
	printer.
	* gcc.dg/tree-ssa/vrp92.c: Same.

From-SVN: r266077
parent 7f9414c1
2018-11-13 Aldy Hernandez <aldyh@redhat.com>
* tree-vrp.c (value_range_base::dump): Dump type.
Do not use INF nomenclature for 1-bit types.
(dump_value_range): Group all variants to common dumping code.
(debug): New overloaded functions for value_ranges.
(value_range_base::dump): Remove no argument version.
(value_range::dump): Same.
2018-11-13 Richard Biener <rguenther@suse.de>
PR tree-optimization/87931
2018-11-12 Aldy Hernandez <aldyh@redhat.com>
* gcc.dg/tree-ssa/pr64130.c: Adjust for new value_range pretty
printer.
* gcc.dg/tree-ssa/vrp92.c: Same.
2018-11-13 Richard Biener <rguenther@suse.de>
PR tree-optimization/87931
......
......@@ -15,6 +15,6 @@ int funsigned2 (uint32_t a)
return (-1 * 0x1ffffffffL) / a == 0;
}
/* { dg-final { scan-tree-dump ": \\\[2, 8589934591\\\]" "evrp" } } */
/* { dg-final { scan-tree-dump ": \\\[-8589934591, -2\\\]" "evrp" } } */
/* { dg-final { scan-tree-dump "int \\\[2, 8589934591\\\]" "evrp" } } */
/* { dg-final { scan-tree-dump "int \\\[-8589934591, -2\\\]" "evrp" } } */
......@@ -18,5 +18,5 @@ int foo (int i, int j)
return j;
}
/* { dg-final { scan-tree-dump "res_.: \\\[1, 1\\\]" "vrp1" } } */
/* { dg-final { scan-tree-dump "res_.: int \\\[1, 1\\\]" "vrp1" } } */
/* { dg-final { scan-tree-dump-not "Threaded" "vrp1" } } */
......@@ -365,8 +365,6 @@ value_range_base::type () const
return TREE_TYPE (min ());
}
/* Dump value range to FILE. */
void
value_range_base::dump (FILE *file) const
{
......@@ -374,21 +372,26 @@ value_range_base::dump (FILE *file) const
fprintf (file, "UNDEFINED");
else if (m_kind == VR_RANGE || m_kind == VR_ANTI_RANGE)
{
tree type = TREE_TYPE (min ());
tree ttype = type ();
print_generic_expr (file, ttype);
fprintf (file, " ");
fprintf (file, "%s[", (m_kind == VR_ANTI_RANGE) ? "~" : "");
if (INTEGRAL_TYPE_P (type)
&& !TYPE_UNSIGNED (type)
&& vrp_val_is_min (min ()))
if (INTEGRAL_TYPE_P (ttype)
&& !TYPE_UNSIGNED (ttype)
&& vrp_val_is_min (min ())
&& TYPE_PRECISION (ttype) != 1)
fprintf (file, "-INF");
else
print_generic_expr (file, min ());
fprintf (file, ", ");
if (INTEGRAL_TYPE_P (type)
&& vrp_val_is_max (max ()))
if (INTEGRAL_TYPE_P (ttype)
&& vrp_val_is_max (max ())
&& TYPE_PRECISION (ttype) != 1)
fprintf (file, "+INF");
else
print_generic_expr (file, max ());
......@@ -398,7 +401,7 @@ value_range_base::dump (FILE *file) const
else if (varying_p ())
fprintf (file, "VARYING");
else
fprintf (file, "INVALID RANGE");
gcc_unreachable ();
}
void
......@@ -425,17 +428,45 @@ value_range::dump (FILE *file) const
}
void
value_range_base::dump () const
dump_value_range (FILE *file, const value_range *vr)
{
dump_value_range (stderr, this);
fprintf (stderr, "\n");
if (!vr)
fprintf (file, "[]");
else
vr->dump (file);
}
void
value_range::dump () const
dump_value_range (FILE *file, const value_range_base *vr)
{
if (!vr)
fprintf (file, "[]");
else
vr->dump (file);
}
DEBUG_FUNCTION void
debug (const value_range_base *vr)
{
dump_value_range (stderr, vr);
}
DEBUG_FUNCTION void
debug (const value_range_base &vr)
{
dump_value_range (stderr, &vr);
}
DEBUG_FUNCTION void
debug (const value_range *vr)
{
dump_value_range (stderr, vr);
}
DEBUG_FUNCTION void
debug (const value_range &vr)
{
dump_value_range (stderr, this);
fprintf (stderr, "\n");
dump_value_range (stderr, &vr);
}
/* Return true if the SSA name NAME is live on the edge E. */
......@@ -2165,43 +2196,6 @@ extract_range_from_unary_expr (value_range_base *vr,
return;
}
/* Debugging dumps. */
void
dump_value_range (FILE *file, const value_range *vr)
{
if (!vr)
fprintf (file, "[]");
else
vr->dump (file);
}
void
dump_value_range (FILE *file, const value_range_base *vr)
{
if (!vr)
fprintf (file, "[]");
else
vr->dump (file);
}
/* Dump value range VR to stderr. */
DEBUG_FUNCTION void
debug_value_range (const value_range_base *vr)
{
dump_value_range (stderr, vr);
}
/* Dump value range VR to stderr. */
DEBUG_FUNCTION void
debug_value_range (const value_range *vr)
{
dump_value_range (stderr, vr);
}
/* Given a COND_EXPR COND of the form 'V OP W', and an SSA name V,
create a new SSA name N and return the assertion assignment
'N = ASSERT_EXPR <V, V OP W>'. */
......
......@@ -71,9 +71,7 @@ public:
void set_and_canonicalize (enum value_range_kind, tree, tree);
bool zero_p () const;
bool singleton_p (tree *result = NULL) const;
void dump (FILE *) const;
void dump () const;
protected:
void check ();
......@@ -139,7 +137,6 @@ class GTY((user)) value_range : public value_range_base
void deep_copy (const value_range *);
void set_and_canonicalize (enum value_range_kind, tree, tree, bitmap = NULL);
void dump (FILE *) const;
void dump () const;
private:
/* Deep-copies bitmap argument. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment