* tree-ssa-alias.h (dump_points_to_solution): Declare.
* tree-inline.c (expand_call_inline): Reset the escaped and
callused solutions.
* tree-ssa-structalias.c (pass_build_ealias): New.
* tree-pass.h (pass_build_ealias): Declare.
* passes.c (init_optimization_passes): Add PTA during
early optimizations.
* tree-ssa-alias.c (dump_alias_info): Dump the ESCAPED
and CALLUSED solutions.
(dump_points_to_solution): New function, split out from ...
(dump_points_to_info_for): ... here.
* tree-parloops.c (parallelize_loops): Reset the escaped and
callused solutions.
* gcc.dg/tree-ssa/ssa-fre-14.c: Adjust.
* gcc.dg/tree-ssa/ssa-fre-15.c: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@147848
138bc75d-0d04-0410-961f-
82ee72b054a4
+2009-05-25 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-alias.h (dump_points_to_solution): Declare.
+ * tree-inline.c (expand_call_inline): Reset the escaped and
+ callused solutions.
+ * tree-ssa-structalias.c (pass_build_ealias): New.
+ * tree-pass.h (pass_build_ealias): Declare.
+ * passes.c (init_optimization_passes): Add PTA during
+ early optimizations.
+ * tree-ssa-alias.c (dump_alias_info): Dump the ESCAPED
+ and CALLUSED solutions.
+ (dump_points_to_solution): New function, split out from ...
+ (dump_points_to_info_for): ... here.
+ * tree-parloops.c (parallelize_loops): Reset the escaped and
+ callused solutions.
+
2009-05-25 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
PR bootstrap/40027
NEXT_PASS (pass_rename_ssa_copies);
NEXT_PASS (pass_ccp);
NEXT_PASS (pass_forwprop);
- NEXT_PASS (pass_update_address_taken);
+ /* pass_build_ealias is a dummy pass that ensures that we
+ execute TODO_rebuild_alias at this point. Re-building
+ alias information also rewrites no longer addressed
+ locals into SSA form if possible. */
+ NEXT_PASS (pass_build_ealias);
NEXT_PASS (pass_sra_early);
NEXT_PASS (pass_copy_prop);
NEXT_PASS (pass_merge_phi);
+2009-05-25 Richard Guenther <rguenther@suse.de>
+
+ * gcc.dg/tree-ssa/ssa-fre-14.c: Adjust.
+ * gcc.dg/tree-ssa/ssa-fre-15.c: Likewise.
+
2009-05-25 Ira Rosen <irar@il.ibm.com>
PR tree-optimization/40238
void *data;
double size;
};
+void bar(double *);
void foo(double (*q)[4])
{
struct Foo tmp1;
this store to tmp1 here. */
tmp1.size -= 1.0;
}
+ bar(a);
}
/* { dg-final { scan-tree-dump "Inserted .* &a" "fre" } } */
void *data;
double size;
};
+void bar(double *);
void foo(double (*q)[4])
{
struct Foo tmp1;
this store to tmp1 here. */
tmp1.size -= 1.0;
}
+ bar(a);
}
/* { dg-final { scan-tree-dump "Replaced" "fre" } } */
duplicate our body before altering anything. */
copy_body (id, bb->count, bb->frequency, bb, return_block);
+ /* Reset the escaped and callused solutions. */
+ if (cfun->gimple_df)
+ {
+ pt_solution_reset (&cfun->gimple_df->escaped);
+ pt_solution_reset (&cfun->gimple_df->callused);
+ }
+
/* Clean up. */
pointer_map_destroy (id->decl_map);
id->decl_map = st;
free_stmt_vec_info_vec ();
htab_delete (reduction_list);
+
+ /* Parallelization will cause new function calls to be inserted through
+ which local variables will escape. Reset the points-to solutions
+ for ESCAPED and CALLUSED. */
+ if (changed)
+ {
+ pt_solution_reset (&cfun->gimple_df->escaped);
+ pt_solution_reset (&cfun->gimple_df->callused);
+ }
+
return changed;
}
extern struct gimple_opt_pass pass_phi_only_cprop;
extern struct gimple_opt_pass pass_build_ssa;
extern struct gimple_opt_pass pass_build_alias;
+extern struct gimple_opt_pass pass_build_ealias;
extern struct gimple_opt_pass pass_dominator;
extern struct gimple_opt_pass pass_dce;
extern struct gimple_opt_pass pass_dce_loop;
dump_variable (file, var);
}
- fprintf (file, "\n\nFlow-insensitive points-to information for %s\n\n", funcname);
+ fprintf (file, "\nCall clobber information\n");
+
+ fprintf (file, "\nESCAPED");
+ dump_points_to_solution (file, &cfun->gimple_df->escaped);
+ fprintf (file, "\nCALLUSED");
+ dump_points_to_solution (file, &cfun->gimple_df->callused);
+
+ fprintf (file, "\n\nFlow-insensitive points-to information\n\n");
for (i = 1; i < num_ssa_names; i++)
{
return pi;
}
-/* Dump points-to information for SSA_NAME PTR into FILE. */
+/* Dump the points-to set *PT into FILE. */
void
-dump_points_to_info_for (FILE *file, tree ptr)
+dump_points_to_solution (FILE *file, struct pt_solution *pt)
{
- struct ptr_info_def *pi = SSA_NAME_PTR_INFO (ptr);
+ if (pt->anything)
+ fprintf (file, ", points-to anything");
- print_generic_expr (file, ptr, dump_flags);
+ if (pt->nonlocal)
+ fprintf (file, ", points-to non-local");
- if (pi)
+ if (pt->escaped)
+ fprintf (file, ", points-to escaped");
+
+ if (pt->null)
+ fprintf (file, ", points-to NULL");
+
+ if (pt->vars)
{
- if (pi->pt.anything)
- fprintf (file, ", points-to anything");
+ fprintf (file, ", points-to vars: ");
+ dump_decl_set (file, pt->vars);
+ if (pt->vars_contains_global)
+ fprintf (file, " (includes global vars)");
+ }
+}
- if (pi->pt.nonlocal)
- fprintf (file, ", points-to non-local");
+/* Dump points-to information for SSA_NAME PTR into FILE. */
- if (pi->pt.escaped)
- fprintf (file, ", points-to escaped");
+void
+dump_points_to_info_for (FILE *file, tree ptr)
+{
+ struct ptr_info_def *pi = SSA_NAME_PTR_INFO (ptr);
- if (pi->pt.null)
- fprintf (file, ", points-to NULL");
+ print_generic_expr (file, ptr, dump_flags);
- if (pi->pt.vars)
- {
- fprintf (file, ", points-to vars: ");
- dump_decl_set (file, pi->pt.vars);
- if (pi->pt.vars_contains_global)
- fprintf (file, " (includes global vars)");
- }
- }
+ if (pi)
+ dump_points_to_solution (file, &pi->pt);
+ else
+ fprintf (file, ", points-to anything");
fprintf (file, "\n");
}
extern struct ptr_info_def *get_ptr_info (tree);
extern void dump_alias_info (FILE *);
extern void debug_alias_info (void);
+extern void dump_points_to_solution (FILE *, struct pt_solution *);
extern void dump_points_to_info_for (FILE *, tree);
extern void debug_points_to_info_for (tree);
extern void dump_alias_stats (FILE *);
}
};
+/* A dummy pass to cause points-to information to be computed via
+ TODO_rebuild_alias. */
+
+struct gimple_opt_pass pass_build_ealias =
+{
+ {
+ GIMPLE_PASS,
+ "ealias", /* name */
+ gate_tree_pta, /* gate */
+ NULL, /* execute */
+ NULL, /* sub */
+ NULL, /* next */
+ 0, /* static_pass_number */
+ TV_NONE, /* tv_id */
+ PROP_cfg | PROP_ssa, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_rebuild_alias | TODO_dump_func /* todo_flags_finish */
+ }
+};
+
/* Return true if we should execute IPA PTA. */
static bool