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
+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>
* config/m32r/m32r-protos.h: Remove m32r_finalize_pic.
--- /dev/null
+/* { 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" } } */
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.var = readonly_id;
}
- else
- cexpr.var = get_id_for_tree (t);
cexpr.offset = 0;
return cexpr;