aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-sra.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2007-02-14 09:52:25 -0800
committerRichard Henderson <rth@gcc.gnu.org>2007-02-14 09:52:25 -0800
commit029f45bdc15fe9c0b6fdafe5b2aa973c62c6eaf1 (patch)
tree9fdff1e4943f3d35a0f3e5fcfb194ad9450680cd /gcc/tree-sra.c
parentc4e74b1aaa92e2f0ab21af1c08c52819867b32b2 (diff)
downloadgcc-029f45bdc15fe9c0b6fdafe5b2aa973c62c6eaf1.zip
gcc-029f45bdc15fe9c0b6fdafe5b2aa973c62c6eaf1.tar.gz
gcc-029f45bdc15fe9c0b6fdafe5b2aa973c62c6eaf1.tar.bz2
tree-sra.c (early_sra): New.
* tree-sra.c (early_sra): New. (decl_can_be_decomposed_p): Deny va_list if early_sra. (tree_sra_early, pass_sra_early): New. * tree-pass.h (pass_sra_early): Declare. * passes.c (init_optimization_passes): Use it. From-SVN: r121953
Diffstat (limited to 'gcc/tree-sra.c')
-rw-r--r--gcc/tree-sra.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index 03f9b59..e4a1107 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -75,6 +75,9 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
*/
+/* True if this is the "early" pass, before inlining. */
+static bool early_sra;
+
/* The set of todo flags to return from tree_sra. */
static unsigned int todoflags;
@@ -342,6 +345,17 @@ decl_can_be_decomposed_p (tree var)
return false;
}
+ /* HACK: if we decompose a va_list_type_node before inlining, then we'll
+ confuse tree-stdarg.c, and we won't be able to figure out which and
+ how many arguments are accessed. This really should be improved in
+ tree-stdarg.c, as the decomposition is truely a win. This could also
+ be fixed if the stdarg pass ran early, but this can't be done until
+ we've aliasing information early too. See PR 30791. */
+ if (early_sra
+ && TYPE_MAIN_VARIANT (TREE_TYPE (var))
+ == TYPE_MAIN_VARIANT (va_list_type_node))
+ return false;
+
return true;
}
@@ -2365,12 +2379,44 @@ tree_sra (void)
return todoflags;
}
+static unsigned int
+tree_sra_early (void)
+{
+ unsigned int ret;
+
+ early_sra = true;
+ ret = tree_sra ();
+ early_sra = false;
+
+ return ret;
+}
+
static bool
gate_sra (void)
{
return flag_tree_sra != 0;
}
+struct tree_opt_pass pass_sra_early =
+{
+ "esra", /* name */
+ gate_sra, /* gate */
+ tree_sra_early, /* execute */
+ NULL, /* sub */
+ NULL, /* next */
+ 0, /* static_pass_number */
+ TV_TREE_SRA, /* tv_id */
+ PROP_cfg | PROP_ssa, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_dump_func
+ | TODO_update_ssa
+ | TODO_ggc_collect
+ | TODO_verify_ssa, /* todo_flags_finish */
+ 0 /* letter */
+};
+
struct tree_opt_pass pass_sra =
{
"sra", /* name */