Commit ebd7d910 by Richard Biener Committed by Richard Biener

tree-ssa-structalias.c (readonly_id): Rename to string_id.

2014-08-15  Richard Biener  <rguenther@suse.de>

	* tree-ssa-structalias.c (readonly_id): Rename to string_id.
	(get_constraint_for_ssa_var): Remove dead code.
	(get_constraint_for_1): Adjust.
	(find_what_var_points_to): Likewise.
	(init_base_vars): Likewise.  STRING_CSTs do not contain pointers.

From-SVN: r214020
parent 275be1da
2014-08-15 Richard Biener <rguenther@suse.de>
* tree-ssa-structalias.c (readonly_id): Rename to string_id.
(get_constraint_for_ssa_var): Remove dead code.
(get_constraint_for_1): Adjust.
(find_what_var_points_to): Likewise.
(init_base_vars): Likewise. STRING_CSTs do not contain pointers.
2014-08-15 Ilya Tocar <tocarip@gmail.com> 2014-08-15 Ilya Tocar <tocarip@gmail.com>
PR target/61878 PR target/61878
......
...@@ -344,7 +344,7 @@ vi_next (varinfo_t vi) ...@@ -344,7 +344,7 @@ vi_next (varinfo_t vi)
/* Static IDs for the special variables. Variable ID zero is unused /* Static IDs for the special variables. Variable ID zero is unused
and used as terminator for the sub-variable chain. */ and used as terminator for the sub-variable chain. */
enum { nothing_id = 1, anything_id = 2, readonly_id = 3, enum { nothing_id = 1, anything_id = 2, string_id = 3,
escaped_id = 4, nonlocal_id = 5, escaped_id = 4, nonlocal_id = 5,
storedanything_id = 6, integer_id = 7 }; storedanything_id = 6, integer_id = 7 };
...@@ -2938,14 +2938,6 @@ get_constraint_for_ssa_var (tree t, vec<ce_s> *results, bool address_p) ...@@ -2938,14 +2938,6 @@ get_constraint_for_ssa_var (tree t, vec<ce_s> *results, bool address_p)
cexpr.var = vi->id; cexpr.var = vi->id;
cexpr.type = SCALAR; cexpr.type = SCALAR;
cexpr.offset = 0; cexpr.offset = 0;
/* If we determine the result is "anything", and we know this is readonly,
say it points to readonly memory instead. */
if (cexpr.var == anything_id && TREE_READONLY (t))
{
gcc_unreachable ();
cexpr.type = ADDRESSOF;
cexpr.var = readonly_id;
}
/* If we are not taking the address of the constraint expr, add all /* If we are not taking the address of the constraint expr, add all
sub-fiels of the variable as well. */ sub-fiels of the variable as well. */
...@@ -3380,10 +3372,11 @@ get_constraint_for_1 (tree t, vec<ce_s> *results, bool address_p, ...@@ -3380,10 +3372,11 @@ get_constraint_for_1 (tree t, vec<ce_s> *results, bool address_p,
return; return;
} }
/* String constants are read-only. */ /* String constants are read-only, ideally we'd have a CONST_DECL
for those. */
if (TREE_CODE (t) == STRING_CST) if (TREE_CODE (t) == STRING_CST)
{ {
temp.var = readonly_id; temp.var = string_id;
temp.type = SCALAR; temp.type = SCALAR;
temp.offset = 0; temp.offset = 0;
results->safe_push (temp); results->safe_push (temp);
...@@ -6112,8 +6105,8 @@ find_what_var_points_to (varinfo_t orig_vi) ...@@ -6112,8 +6105,8 @@ find_what_var_points_to (varinfo_t orig_vi)
else if (vi->is_heap_var) else if (vi->is_heap_var)
/* We represent heapvars in the points-to set properly. */ /* We represent heapvars in the points-to set properly. */
; ;
else if (vi->id == readonly_id) else if (vi->id == string_id)
/* Nobody cares. */ /* Nobody cares - STRING_CSTs are read-only entities. */
; ;
else if (vi->id == anything_id else if (vi->id == anything_id
|| vi->id == integer_id) || vi->id == integer_id)
...@@ -6501,7 +6494,7 @@ init_base_vars (void) ...@@ -6501,7 +6494,7 @@ init_base_vars (void)
struct constraint_expr lhs, rhs; struct constraint_expr lhs, rhs;
varinfo_t var_anything; varinfo_t var_anything;
varinfo_t var_nothing; varinfo_t var_nothing;
varinfo_t var_readonly; varinfo_t var_string;
varinfo_t var_escaped; varinfo_t var_escaped;
varinfo_t var_nonlocal; varinfo_t var_nonlocal;
varinfo_t var_storedanything; varinfo_t var_storedanything;
...@@ -6547,27 +6540,17 @@ init_base_vars (void) ...@@ -6547,27 +6540,17 @@ init_base_vars (void)
but this one are redundant. */ but this one are redundant. */
constraints.safe_push (new_constraint (lhs, rhs)); constraints.safe_push (new_constraint (lhs, rhs));
/* Create the READONLY variable, used to represent that a variable /* Create the STRING variable, used to represent that a variable
points to readonly memory. */ points to a string literal. String literals don't contain
var_readonly = new_var_info (NULL_TREE, "READONLY"); pointers so STRING doesn't point to anything. */
gcc_assert (var_readonly->id == readonly_id); var_string = new_var_info (NULL_TREE, "STRING");
var_readonly->is_artificial_var = 1; gcc_assert (var_string->id == string_id);
var_readonly->offset = 0; var_string->is_artificial_var = 1;
var_readonly->size = ~0; var_string->offset = 0;
var_readonly->fullsize = ~0; var_string->size = ~0;
var_readonly->is_special_var = 1; var_string->fullsize = ~0;
var_string->is_special_var = 1;
/* readonly memory points to anything, in order to make deref var_string->may_have_pointers = 0;
easier. In reality, it points to anything the particular
readonly variable can point to, but we don't track this
separately. */
lhs.type = SCALAR;
lhs.var = readonly_id;
lhs.offset = 0;
rhs.type = ADDRESSOF;
rhs.var = readonly_id; /* FIXME */
rhs.offset = 0;
process_constraint (new_constraint (lhs, rhs));
/* Create the ESCAPED variable, used to represent the set of escaped /* Create the ESCAPED variable, used to represent the set of escaped
memory. */ memory. */
......
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