Commit 47bcb538 by Daniel Berlin Committed by Daniel Berlin

tree-ssa-structalias.c (get_constraint_exp_from_ssa_var): Only fall back to…

tree-ssa-structalias.c (get_constraint_exp_from_ssa_var): Only fall back to saying it points to readonly memory if we can't do better.

2005-07-04  Daniel Berlin  <dberlin@dberlin.org>

	* tree-ssa-structalias.c (get_constraint_exp_from_ssa_var):
	Only fall back to saying it points to readonly memory if
	we can't do better.

From-SVN: r101625
parent cdc9bfe6
2005-07-04 Daniel Berlin <dberlin@dberlin.org>
* tree-ssa-structalias.c (get_constraint_exp_from_ssa_var):
Only fall back to saying it points to readonly memory if
we can't do better.
2005-07-05 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com> 2005-07-05 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
* config/m32r/m32r-protos.h: Remove m32r_finalize_pic. * config/m32r/m32r-protos.h: Remove m32r_finalize_pic.
......
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-pta1" } */
extern double cos (double);
extern double sin (double);
double f(double a)
{
double b;
double c,d;
double (*fp) (double);
if (a < 2.0)
{
fp = sin;
c = fp (a);
}
else
{
c = 1.0;
fp = cos;
}
d = fp (a);
return d + c;
}
/* The points-to set of the final function pointer should be "sin cos" */
/* { dg-final { scan-tree-dump-times "sin cos" 1 "pta1"} } */
/* { dg-final { cleanup-tree-dump "pta1" } } */
...@@ -1849,13 +1849,14 @@ get_constraint_exp_from_ssa_var (tree t) ...@@ -1849,13 +1849,14 @@ get_constraint_exp_from_ssa_var (tree t)
cexpr.type = SCALAR; cexpr.type = SCALAR;
if (TREE_READONLY (t)) cexpr.var = get_id_for_tree (t);
/* 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))
{ {
cexpr.type = ADDRESSOF; cexpr.type = ADDRESSOF;
cexpr.var = readonly_id; cexpr.var = readonly_id;
} }
else
cexpr.var = get_id_for_tree (t);
cexpr.offset = 0; cexpr.offset = 0;
return cexpr; return cexpr;
......
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