gimple-pretty-print.c: Various whitespace tweaks.

2013-09-24  Christophe Lyon  <christophe.lyon@linaro.org>

	* gimple-pretty-print.c: Various whitespace tweaks.
	* tree-core.h: Likewise.
	* tree-pretty-print.c: Likewise.
	* tree-ssa-alias.c: Likewise.
	* tree-ssa-copy.c: Likewise.
	* tree-ssanames.c: Likewise.
	* tree-ssanames.h: Likewise.
	* tree-vrp.c: Likewise.

From-SVN: r202869
This commit is contained in:
Christophe Lyon 2013-09-24 15:57:00 +00:00 committed by Christophe Lyon
parent 5a8c2b571c
commit 0498471be6
9 changed files with 89 additions and 78 deletions

View File

@ -1,3 +1,14 @@
2013-09-24 Christophe Lyon <christophe.lyon@linaro.org>
* gimple-pretty-print.c: Various whitespace tweaks.
* tree-core.h: Likewise.
* tree-pretty-print.c: Likewise.
* tree-ssa-alias.c: Likewise.
* tree-ssa-copy.c: Likewise.
* tree-ssanames.c: Likewise.
* tree-ssanames.h: Likewise.
* tree-vrp.c: Likewise.
2013-09-24 Alan Modra <amodra@gmail.com>
PR middle-end/57134

View File

@ -1632,17 +1632,17 @@ dump_ssaname_info (pretty_printer *buffer, tree node, int spc)
value_range_type range_type = get_range_info (node, &min, &max);
if (range_type == VR_VARYING)
pp_printf (buffer, "# RANGE VR_VARYING");
pp_printf (buffer, "# RANGE VR_VARYING");
else if (range_type == VR_RANGE || range_type == VR_ANTI_RANGE)
{
pp_printf (buffer, "# RANGE ");
pp_printf (buffer, "%s[", range_type == VR_RANGE ? "" : "~");
pp_double_int (buffer, min, TYPE_UNSIGNED (TREE_TYPE (node)));
pp_printf (buffer, ", ");
pp_double_int (buffer, max, TYPE_UNSIGNED (TREE_TYPE (node)));
pp_printf (buffer, "]");
newline_and_indent (buffer, spc);
}
{
pp_printf (buffer, "# RANGE ");
pp_printf (buffer, "%s[", range_type == VR_RANGE ? "" : "~");
pp_double_int (buffer, min, TYPE_UNSIGNED (TREE_TYPE (node)));
pp_printf (buffer, ", ");
pp_double_int (buffer, max, TYPE_UNSIGNED (TREE_TYPE (node)));
pp_printf (buffer, "]");
newline_and_indent (buffer, spc);
}
}
}
@ -1661,8 +1661,8 @@ dump_gimple_phi (pretty_printer *buffer, gimple phi, int spc, int flags)
dump_ssaname_info (buffer, lhs, spc);
if (flags & TDF_RAW)
dump_gimple_fmt (buffer, spc, flags, "%G <%T, ", phi,
gimple_phi_result (phi));
dump_gimple_fmt (buffer, spc, flags, "%G <%T, ", phi,
gimple_phi_result (phi));
else
{
dump_generic_node (buffer, lhs, spc, flags, false);

View File

@ -1058,7 +1058,7 @@ struct GTY(()) tree_ssa_name {
/* Value range attributes used for zero/sign extension elimination. */
struct GTY ((tag ("1"))) range_info_def *range_info;
} GTY ((desc ("%1.typed.type ?" \
"!POINTER_TYPE_P (TREE_TYPE ((tree)&%1)) : 2"))) info;
"!POINTER_TYPE_P (TREE_TYPE ((tree)&%1)) : 2"))) info;
/* Immediate uses list for this SSA_NAME. */
struct ssa_use_operand_d imm_uses;

View File

@ -1063,8 +1063,8 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
pp_string (buffer, "B"); /* pseudo-unit */
}
else
pp_double_int (buffer, tree_to_double_int (node),
TYPE_UNSIGNED (TREE_TYPE (node)));
pp_double_int (buffer, tree_to_double_int (node),
TYPE_UNSIGNED (TREE_TYPE (node)));
break;
case REAL_CST:
@ -3191,16 +3191,16 @@ pp_double_int (pretty_printer *pp, double_int d, bool uns)
unsigned HOST_WIDE_INT low = d.low;
HOST_WIDE_INT high = d.high;
if (!uns && d.is_negative ())
{
pp_minus (pp);
high = ~high + !low;
low = -low;
}
{
pp_minus (pp);
high = ~high + !low;
low = -low;
}
/* Would "%x%0*x" or "%x%*0x" get zero-padding on all
systems? */
systems? */
sprintf (pp_buffer (pp)->digit_buffer,
HOST_WIDE_INT_PRINT_DOUBLE_HEX,
(unsigned HOST_WIDE_INT) high, low);
HOST_WIDE_INT_PRINT_DOUBLE_HEX,
(unsigned HOST_WIDE_INT) high, low);
pp_string (pp, pp_buffer (pp)->digit_buffer);
}
}

View File

@ -404,7 +404,7 @@ dump_alias_info (FILE *file)
struct ptr_info_def *pi;
if (ptr == NULL_TREE
|| !POINTER_TYPE_P (TREE_TYPE (ptr))
|| !POINTER_TYPE_P (TREE_TYPE (ptr))
|| SSA_NAME_IN_FREE_LIST (ptr))
continue;

View File

@ -767,19 +767,19 @@ fini_copy_prop (void)
of the representative to the first solution we find if
it doesn't have one already. */
if (copy_of[i].value != var
&& TREE_CODE (copy_of[i].value) == SSA_NAME)
{
if (POINTER_TYPE_P (TREE_TYPE (var))
&& SSA_NAME_PTR_INFO (var)
&& !SSA_NAME_PTR_INFO (copy_of[i].value))
duplicate_ssa_name_ptr_info (copy_of[i].value,
SSA_NAME_PTR_INFO (var));
else if (!POINTER_TYPE_P (TREE_TYPE (var))
&& SSA_NAME_RANGE_INFO (var)
&& !SSA_NAME_RANGE_INFO (copy_of[i].value))
duplicate_ssa_name_range_info (copy_of[i].value,
SSA_NAME_RANGE_INFO (var));
}
&& TREE_CODE (copy_of[i].value) == SSA_NAME)
{
if (POINTER_TYPE_P (TREE_TYPE (var))
&& SSA_NAME_PTR_INFO (var)
&& !SSA_NAME_PTR_INFO (copy_of[i].value))
duplicate_ssa_name_ptr_info (copy_of[i].value,
SSA_NAME_PTR_INFO (var));
else if (!POINTER_TYPE_P (TREE_TYPE (var))
&& SSA_NAME_RANGE_INFO (var)
&& !SSA_NAME_RANGE_INFO (copy_of[i].value))
duplicate_ssa_name_range_info (copy_of[i].value,
SSA_NAME_RANGE_INFO (var));
}
}
/* Don't do DCE if SCEV is initialized. It would destroy the scev cache. */

View File

@ -206,7 +206,7 @@ get_range_info (tree name, double_int *min, double_int *max)
/* Return VR_VARYING for SSA_NAMEs with NULL RANGE_INFO or SSA_NAMEs
with integral types width > 2 * HOST_BITS_PER_WIDE_INT precision. */
if (!ri || (GET_MODE_PRECISION (TYPE_MODE (TREE_TYPE (name)))
> 2 * HOST_BITS_PER_WIDE_INT))
> 2 * HOST_BITS_PER_WIDE_INT))
return VR_VARYING;
/* If min > max, it is VR_ANTI_RANGE. */
@ -455,14 +455,14 @@ duplicate_ssa_name_fn (struct function *fn, tree name, gimple stmt)
struct ptr_info_def *old_ptr_info = SSA_NAME_PTR_INFO (name);
if (old_ptr_info)
duplicate_ssa_name_ptr_info (new_name, old_ptr_info);
duplicate_ssa_name_ptr_info (new_name, old_ptr_info);
}
else
{
struct range_info_def *old_range_info = SSA_NAME_RANGE_INFO (name);
if (old_range_info)
duplicate_ssa_name_range_info (new_name, old_range_info);
duplicate_ssa_name_range_info (new_name, old_range_info);
}
return new_name;

View File

@ -71,7 +71,7 @@ enum value_range_type { VR_UNDEFINED, VR_RANGE, VR_ANTI_RANGE, VR_VARYING };
extern void set_range_info (tree ssa, double_int min, double_int max);
/* Gets the value range from SSA. */
extern enum value_range_type get_range_info (tree name, double_int *min,
double_int *max);
double_int *max);
extern void init_ssanames (struct function *, int);
extern void fini_ssanames (void);
extern void ssanames_print_statistics (void);

View File

@ -9451,48 +9451,48 @@ vrp_finalize (void)
/* Set value range to non pointer SSA_NAMEs. */
for (i = 0; i < num_vr_values; i++)
if (vr_value[i])
{
tree name = ssa_name (i);
if (vr_value[i])
{
tree name = ssa_name (i);
if (!name
|| POINTER_TYPE_P (TREE_TYPE (name))
|| (vr_value[i]->type == VR_VARYING)
|| (vr_value[i]->type == VR_UNDEFINED))
continue;
|| (vr_value[i]->type == VR_VARYING)
|| (vr_value[i]->type == VR_UNDEFINED))
continue;
if ((TREE_CODE (vr_value[i]->min) == INTEGER_CST)
&& (TREE_CODE (vr_value[i]->max) == INTEGER_CST))
{
if (vr_value[i]->type == VR_RANGE)
set_range_info (name,
tree_to_double_int (vr_value[i]->min),
tree_to_double_int (vr_value[i]->max));
else if (vr_value[i]->type == VR_ANTI_RANGE)
{
/* VR_ANTI_RANGE ~[min, max] is encoded compactly as
[max + 1, min - 1] without additional attributes.
When min value > max value, we know that it is
VR_ANTI_RANGE; it is VR_RANGE otherwise. */
if ((TREE_CODE (vr_value[i]->min) == INTEGER_CST)
&& (TREE_CODE (vr_value[i]->max) == INTEGER_CST))
{
if (vr_value[i]->type == VR_RANGE)
set_range_info (name,
tree_to_double_int (vr_value[i]->min),
tree_to_double_int (vr_value[i]->max));
else if (vr_value[i]->type == VR_ANTI_RANGE)
{
/* VR_ANTI_RANGE ~[min, max] is encoded compactly as
[max + 1, min - 1] without additional attributes.
When min value > max value, we know that it is
VR_ANTI_RANGE; it is VR_RANGE otherwise. */
/* ~[0,0] anti-range is represented as
range. */
if (TYPE_UNSIGNED (TREE_TYPE (name))
&& integer_zerop (vr_value[i]->min)
&& integer_zerop (vr_value[i]->max))
set_range_info (name,
double_int_one,
double_int::max_value
(TYPE_PRECISION (TREE_TYPE (name)), true));
else
set_range_info (name,
tree_to_double_int (vr_value[i]->max)
+ double_int_one,
tree_to_double_int (vr_value[i]->min)
- double_int_one);
}
}
}
/* ~[0,0] anti-range is represented as
range. */
if (TYPE_UNSIGNED (TREE_TYPE (name))
&& integer_zerop (vr_value[i]->min)
&& integer_zerop (vr_value[i]->max))
set_range_info (name,
double_int_one,
double_int::max_value
(TYPE_PRECISION (TREE_TYPE (name)), true));
else
set_range_info (name,
tree_to_double_int (vr_value[i]->max)
+ double_int_one,
tree_to_double_int (vr_value[i]->min)
- double_int_one);
}
}
}
/* Free allocated memory. */
for (i = 0; i < num_vr_values; i++)