This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Mainline merge as of 2003-07-06
- From: Diego Novillo <dnovillo at redhat dot com>
- To: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Cc: Toon Moene <toon at moene dot indiv dot nluug dot nl>, Paul Brook <paul at nowt dot org>, Steven Bosscher <s dot bosscher at student dot tudelft dot nl>
- Date: 21 Jul 2003 10:06:28 -0400
- Subject: Re: [tree-ssa] Mainline merge as of 2003-07-06
- Organization: Red Hat Canada
- References: <1058796204.3848.21.camel@frodo.toronto.redhat.com>
On Mon, 2003-07-21 at 10:03, Diego Novillo wrote:
> The branch is now ready for including g95. Many thanks to Steven
> Bosscher for his help in removing merge conflicts.
>
Forgot to include the patch to some of the things that needed to be
fixed post-merge.
2003-07-21 Steven Bosscher <steven@gcc.gnu.org>
Diego Novillo <dnovillo@redhat.com>
* Makefile.in (install-po): Check if $CATALOGS is empty to avoid
buggy shells.
* basic-block.h (rtl_verify_flow_info): Remove.
(tree_verify_flow_info): Remove.
(verify_flow_info): Declare.
* builtins.c: Rearrange to simplify merges. Add #if 0 around
expand_ functions that are not used in the branch and move new code
to the end of the file.
* c-opts.c (c_common_handle_option): Move handling of -fdump- to
opts.c.
* cfgloopmanip.c (loop_split_edge_with_NULL): Remove. Update all
users.
* common.opt: Add all the tree-ssa switches.
* opts.c: Handle them.
* flags.h (flag_tree_cp): Remove unused variable.
(enum pta_type): Move from tree-must-alias.h
(flag_tree_points_to): Likewise.
* toplev.c (flag_tree_cp): Remove unused variable.
* tree-cfg.c: Move cfg_hooks structures and functions for
trees from cfghooks.c.
* tree-mudflap.c (mudflap_enqueue_decl): Don't use %D to
avoid warning about format specifiers.
2003-07-21 Diego Novillo <dnovillo@redhat.com>
* gimplify.c (gimplify_function_tree): Move gimplification of the
function body ...
(gimplify_body): ... here.
* tree-simple.h (gimplify_body): Declare.
* tree-inline.c (initialize_inlined_parameters): If the
emitted assignment is not in GIMPLE form, gimplify the
body of assignments emitted.
--- Makefile.in 2003/07/16 22:27:12 1.1
+++ Makefile.in 2003/07/21 00:35:31
@@ -4116,18 +4116,20 @@ update-po: $(CATALOGS:.gmo=.pox)
# with the distribution.
install-po:
$(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)$(datadir)
- for cat in $(CATALOGS); do \
- lang=`basename $$cat | sed 's/\.gmo$$//'`; \
- if [ -f $$cat ]; then :; \
- elif [ -f $(srcdir)/$$cat ]; then cat=$(srcdir)/$$cat; \
- else continue; \
- fi; \
- dir=$(localedir)/$$lang/LC_MESSAGES; \
- echo $(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)$$dir; \
- $(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)$$dir || exit 1; \
- echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
- $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
- done
+ if [ "${CATALOGS}" != "" ] ; then \
+ for cat in "$(CATALOGS)"; do \
+ lang=`basename $$cat | sed 's/\.gmo$$//'`; \
+ if [ -f $$cat ]; then :; \
+ elif [ -f $(srcdir)/$$cat ]; then cat=$(srcdir)/$$cat; \
+ else continue; \
+ fi; \
+ dir=$(localedir)/$$lang/LC_MESSAGES; \
+ echo $(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)$$dir; \
+ $(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)$$dir || exit 1; \
+ echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
+ $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
+ done \
+ fi
# Rule for regenerating the message template (gcc.pot).
# Instead of forcing everyone to edit POTFILES.in, which proved impractical,
--- basic-block.h 2003/07/16 22:27:12 1.1
+++ basic-block.h 2003/07/16 23:57:09
@@ -593,8 +593,7 @@ extern void free_aux_for_edges PARAMS (
/* This function is always defined so it can be called from the
debugger, and it is declared extern so we don't get warnings about
it being unused. */
-extern void rtl_verify_flow_info PARAMS ((void));
-extern void tree_verify_flow_info PARAMS ((void));
+extern void verify_flow_info PARAMS ((void));
typedef struct conflict_graph_def *conflict_graph;
--- builtins.c 2003/07/16 22:27:12 1.1
+++ builtins.c 2003/07/16 23:17:55
@@ -79,9 +79,9 @@ tree built_in_decls[(int) END_BUILTINS];
required to implement the function call in all cases). */
tree implicit_built_in_decls[(int) END_BUILTINS];
-/* FIXME: When merging tree-ssa into mainline, remove all the #if 0 and
- lines commented with /*@ */. They represent code that was removed in
- the branch. They were only left in to simplify mainline->branch merges. */
+/* FIXME: When merging tree-ssa into mainline, remove all the #if 0 and lines
+ commented with '@' markers. They represent code that was removed in the
+ branch. They were only left in to simplify mainline->branch merges. */
/* Trigonometric and mathematical constants used in builtin folding. */
static bool builtin_dconsts_init = 0;
@@ -125,10 +125,10 @@ static rtx builtin_memcpy_read_str (void
/*@static rtx expand_builtin_strspn (tree, rtx, enum machine_mode);*/
/*@static rtx expand_builtin_strcspn (tree, rtx, enum machine_mode);*/
static rtx expand_builtin_memcpy (tree, rtx, enum machine_mode);
-/*@static rtx expand_builtin_mempcpy (tree, rtx, enum machine_mode, int);*/
+static rtx expand_builtin_mempcpy (tree, rtx, enum machine_mode, int);
static rtx expand_builtin_memmove (tree, rtx, enum machine_mode);
static rtx expand_builtin_bcopy (tree);
-static rtx expand_builtin_strcpy (tree, rtx, enum machine_mode);
+/*@static rtx expand_builtin_strcpy (tree, rtx, enum machine_mode);*/
static rtx expand_builtin_stpcpy (tree, rtx, enum machine_mode);
static rtx builtin_strncpy_read_str (void *, HOST_WIDE_INT, enum machine_mode);
static rtx expand_builtin_strncpy (tree, rtx, enum machine_mode);
@@ -2629,7 +2629,6 @@ expand_builtin_memcpy (tree arglist, rtx
}
}
-#if 0
/* Expand a call to the mempcpy builtin, with arguments in ARGLIST.
Return 0 if we failed the caller should emit a normal call,
otherwise try to get the result in TARGET, if convenient (and in
@@ -2731,7 +2730,6 @@ expand_builtin_mempcpy (tree arglist, rt
return 0;
}
}
-#endif
/* Expand expression EXP, which is a call to the memmove builtin. Return 0
if we failed the caller should emit a normal call. */
@@ -2813,6 +2811,7 @@ expand_builtin_bcopy (tree arglist)
return expand_builtin_memmove (newarglist, const0_rtx, VOIDmode);
}
+#if 0
/* Expand expression EXP, which is a call to the strcpy builtin. Return 0
if we failed the caller should emit a normal call, otherwise try to get
the result in TARGET, if convenient (and in mode MODE if that's
@@ -2843,6 +2842,7 @@ expand_builtin_strcpy (tree arglist, rtx
return expand_expr (build_function_call_expr (fn, arglist),
target, mode, EXPAND_NORMAL);
}
+#endif
/* Expand a call to the stpcpy builtin, with arguments in ARGLIST.
Return 0 if we failed the caller should emit a normal call,
@@ -5027,11 +5027,13 @@ expand_builtin (tree exp, rtx target, rt
return target;
break;
+#if 0
case BUILT_IN_STRCPY:
target = expand_builtin_strcpy (arglist, target, mode);
if (target)
return target;
break;
+#endif
case BUILT_IN_STRNCPY:
target = expand_builtin_strncpy (arglist, target, mode);
@@ -5755,7 +5757,7 @@ fold_builtin (tree exp)
case BUILT_IN_STRLEN:
if (validate_arglist (arglist, POINTER_TYPE, VOID_TYPE))
{
- tree len = c_strlen (TREE_VALUE (arglist));
+ tree len = c_strlen (TREE_VALUE (arglist), 0);
if (len)
{
/* Convert from the internal "sizetype" type to "size_t". */
@@ -6682,7 +6684,7 @@ simplify_builtin_strcpy (arglist)
if (!fn)
return 0;
- len = c_strlen (TREE_VALUE (TREE_CHAIN (arglist)));
+ len = c_strlen (TREE_VALUE (TREE_CHAIN (arglist)), 1);
if (len == 0)
return 0;
@@ -6717,7 +6719,7 @@ simplify_builtin_strncpy (arglist)
return 0;
else
{
- tree slen = c_strlen (TREE_VALUE (TREE_CHAIN (arglist)));
+ tree slen = c_strlen (TREE_VALUE (TREE_CHAIN (arglist)), 0);
tree len = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist)));
tree fn;
@@ -6890,8 +6892,8 @@ simplify_builtin_strcmp (arglist)
return fold (build (MINUS_EXPR, integer_type_node, ind1, ind2));
}
- len = c_strlen (arg1);
- len2 = c_strlen (arg2);
+ len = c_strlen (arg1, 0);
+ len2 = c_strlen (arg2, 0);
if (len)
len = size_binop (PLUS_EXPR, ssize_int (1), len);
@@ -7016,16 +7018,16 @@ simplify_builtin_strncmp (arglist)
/* Perhaps one of the strings is really constant, if so prefer
that constant length over the other string's length. */
if (p1)
- len = c_strlen (arg1);
+ len = c_strlen (arg1, 0);
else if (p2)
- len = c_strlen (arg2);
+ len = c_strlen (arg2, 0);
/* If we still don't have a len, try either string arg as long
as they don't have side effects. */
if (!len && !TREE_SIDE_EFFECTS (arg1))
- len = c_strlen (arg1);
+ len = c_strlen (arg1, 0);
if (!len && !TREE_SIDE_EFFECTS (arg2))
- len = c_strlen (arg2);
+ len = c_strlen (arg2, 0);
/* If we still don't have a length, punt. */
if (!len)
return 0;
@@ -7289,7 +7291,7 @@ simplify_builtin_fputs (arglist, ignore,
/* Get the length of the string passed to fputs. If the length
can't be determined, punt. */
- if (!(len = c_strlen (TREE_VALUE (arglist)))
+ if (!(len = c_strlen (TREE_VALUE (arglist), 0))
|| TREE_CODE (len) != INTEGER_CST)
return 0;
--- c-opts.c 2003/07/16 22:27:12 1.1
+++ c-opts.c 2003/07/17 20:44:50
@@ -139,7 +139,6 @@ missing_arg (enum opt_code code)
case OPT_d:
case OPT_fabi_version_:
case OPT_fbuiltin_:
- case OPT_fdump_:
case OPT_fname_mangling_version_:
case OPT_ftabstop_:
case OPT_fexec_charset_:
@@ -738,11 +737,6 @@ c_common_handle_option (size_t scode, co
cpp_opts->dollars_in_ident = value;
break;
- case OPT_fdump_:
- if (!dump_switch_p (arg))
- result = 0;
- break;
-
case OPT_ffreestanding:
value = !value;
/* Fall through... */
--- cfgloopmanip.c 2003/07/16 22:27:12 1.1
+++ cfgloopmanip.c 2003/07/19 00:22:04
@@ -29,8 +29,6 @@ Software Foundation, 59 Temple Place - S
#include "cfglayout.h"
#include "output.h"
-static basic_block loop_split_edge_with_NULL PARAMS ((edge, struct loops *));
-
static struct loop * duplicate_loop (struct loops *, struct loop *,
struct loop *);
static void duplicate_subloops (struct loops *, struct loop *, struct loop *);
@@ -104,7 +102,7 @@ remove_bbs (dominance_info dom, basic_bl
{
remove_bb_from_loops (bbs[i]);
delete_from_dominance_info (dom, bbs[i]);
- delete_block (bbs[i]);
+ delete_basic_block (bbs[i]);
}
}
@@ -351,7 +349,7 @@ remove_path (struct loops *loops, edge e
fix -- when e->dest has exactly one predecessor, this corresponds
to blocks dominated by e->dest, if not, split the edge. */
if (e->dest->pred->pred_next)
- e = loop_split_edge_with_NULL (e, loops)->pred;
+ e = loop_split_edge_with (e, NULL_RTX, loops)->pred;
/* It may happen that by removing path we remove one or more loops
we belong to. In this case first unloop the loops, then proceed
@@ -1200,7 +1198,7 @@ force_single_succ_latches (struct loops
for (e = loop->header->pred; e->src != loop->latch; e = e->pred_next)
continue;
- loop_split_edge_with_NULL (e, loops);
+ loop_split_edge_with (e, NULL_RTX, loops);
}
loops->state |= LOOPS_HAVE_SIMPLE_LATCHES;
}
@@ -1247,61 +1245,3 @@ loop_split_edge_with (edge e, rtx insns,
return new_bb;
}
-
-/* Same function as "loop_split_edge_with (e, NULL, loops)",
- independent of the tree/rtl representation. */
-
-static basic_block
-loop_split_edge_with_NULL (e, loops)
- edge e;
- struct loops *loops;
-{
- basic_block src, dest, new_bb;
- struct loop *loop_c;
- edge new_e;
-
- src = e->src;
- dest = e->dest;
-
- loop_c = find_common_loop (src->loop_father, dest->loop_father);
-
- /* Create basic block for it. */
-
- if (cfg_level == AT_RTL_LEVEL)
- new_bb = create_basic_block (NULL_RTX, NULL_RTX, EXIT_BLOCK_PTR->prev_bb);
- else
- new_bb = create_bb ();
-
- add_to_dominance_info (loops->cfg.dom, new_bb);
- add_bb_to_loop (new_bb, loop_c);
- new_bb->flags = 0;
-
- new_e = make_edge (new_bb, dest, (cfg_level == AT_RTL_LEVEL) ? EDGE_FALLTHRU : 0);
- new_e->probability = REG_BR_PROB_BASE;
- new_e->count = e->count;
- if (e->flags & EDGE_IRREDUCIBLE_LOOP)
- {
- new_bb->flags |= BB_IRREDUCIBLE_LOOP;
- new_e->flags |= EDGE_IRREDUCIBLE_LOOP;
- }
-
- new_bb->count = e->count;
- new_bb->frequency = EDGE_FREQUENCY (e);
-
- if (cfg_level == AT_RTL_LEVEL)
- cfg_layout_redirect_edge (e, new_bb);
- else
- redirect_edge_succ (e, new_bb);
-
- alloc_aux_for_block (new_bb, sizeof (struct reorder_block_def));
-
- set_immediate_dominator (loops->cfg.dom, new_bb, src);
- set_immediate_dominator (loops->cfg.dom, dest,
- recount_dominator (loops->cfg.dom, dest));
-
- if (dest->loop_father->latch == src)
- dest->loop_father->latch = new_bb;
-
- return new_bb;
-}
-
--- common.opt 2003/07/17 20:26:10 1.1
+++ common.opt 2003/07/20 14:26:10
@@ -235,6 +235,15 @@ Common
fdiagnostics-show-location=
Common Joined RejectNegative
+fdisable-gimple
+Common RejectNegative
+
+fdisable-tree-ssa
+Common RejectNegative
+
+fdump-
+Common Joined RejectNegative
+
fdump-unnumbered
Common
@@ -349,6 +358,9 @@ Common RejectNegative Joined UInteger
fmove-all-movables
Common
+fmudflap
+Common RejectNegative
+
fnew-ra
Common
@@ -517,6 +529,27 @@ Common
ftrapv
Common
+ftree-ccp
+Common
+
+ftree-copyprop
+Common
+
+ftree-dce
+Common
+
+ftree-dominator-opts
+Common
+
+ftree-must-alias
+Common
+
+ftree-points-to=
+Common Joined RejectNegative
+
+ftree-pre
+Common
+
funit-at-a-time
Common
--- flags.h 2003/07/16 22:27:12 1.1
+++ flags.h 2003/07/17 02:12:46
@@ -692,9 +692,6 @@ extern int flag_disable_tree_ssa;
/* Enable SSA-PRE on trees. */
extern int flag_tree_pre;
-/* Enable SSA-CP on trees. */
-extern int flag_tree_cp;
-
/* Enable SSA-CCP on trees. */
extern int flag_tree_ccp;
@@ -710,6 +707,14 @@ extern int flag_tree_dom;
/* Enable promotion of virtual to real operands in must-alias situations. */
extern int flag_tree_must_alias;
+/* Enable points-to analysis on trees. */
+enum pta_type
+ {
+ PTA_NONE,
+ PTA_ANDERSEN
+ };
+extern enum pta_type flag_tree_points_to;
+
/* Nonzero means put zero initialized data in the bss section. */
extern int flag_zero_initialized_in_bss;
--- gimplify.c 2003/07/16 22:27:12 1.1
+++ gimplify.c 2003/07/17 22:55:16
@@ -215,12 +215,9 @@ keep_function_tree_in_gimple_form (tree
int
gimplify_function_tree (tree fndecl)
{
- tree fnbody;
int done;
+ tree fnbody;
tree oldfn;
- tree tmp;
- const char *saved_input_filename = input_filename;
- int saved_lineno = input_line;
/* Don't bother doing anything if the program has errors. */
if (errorcount || sorrycount)
@@ -235,28 +232,46 @@ gimplify_function_tree (tree fndecl)
if (fnbody == NULL_TREE)
return 0;
- timevar_push (TV_TREE_GIMPLIFY);
-
oldfn = current_function_decl;
current_function_decl = fndecl;
+ done = gimplify_body (&fnbody, fndecl);
+
+ DECL_SAVED_TREE (fndecl) = fnbody;
+ current_function_decl = oldfn;
+
+ return done;
+}
+
+
+/* Gimplify the body of statements pointed by BODY_P. FNDECL is the
+ function decl containing BODY. */
+
+int
+gimplify_body (tree *body_p, tree fndecl)
+{
+ int done;
+ const char *saved_input_filename = input_filename;
+ int saved_lineno = input_line;
+
+ timevar_push (TV_TREE_GIMPLIFY);
+
push_gimplify_context ();
/* Unshare most shared trees in the body. */
- unshare_all_trees (fnbody);
+ unshare_all_trees (*body_p);
/* Gimplify the function's body. */
- done = gimplify_stmt (&fnbody);
+ done = gimplify_stmt (body_p);
/* Unshare again, in case gimplification was sloppy. */
- unshare_all_trees (fnbody);
+ unshare_all_trees (*body_p);
/* If there isn't an outer BIND_EXPR, add one. */
- tmp = fnbody;
- if (TREE_CODE (tmp) != BIND_EXPR)
+ if (TREE_CODE (*body_p) != BIND_EXPR)
{
- fnbody = build (BIND_EXPR, void_type_node, NULL_TREE, fnbody, NULL_TREE);
- TREE_SIDE_EFFECTS (fnbody) = 1;
+ *body_p = build (BIND_EXPR, void_type_node, NULL_TREE, *body_p, NULL_TREE);
+ TREE_SIDE_EFFECTS (*body_p) = 1;
input_line = get_lineno (fndecl);
input_filename = get_filename (fndecl);
}
@@ -266,20 +281,17 @@ gimplify_function_tree (tree fndecl)
input_filename = saved_input_filename;
}
- DECL_SAVED_TREE (fndecl) = fnbody;
-
/* Declare the new temporary variables. */
- declare_tmp_vars (gimplify_ctxp->temps, fnbody);
+ declare_tmp_vars (gimplify_ctxp->temps, *body_p);
pop_gimplify_context ();
- current_function_decl = oldfn;
-
timevar_pop (TV_TREE_GIMPLIFY);
return done;
}
+
/* Gimplification of expression trees. */
/* Gimplify an expression which appears at statement context; usually, this
--- opts.c 2003/07/16 22:27:12 1.1
+++ opts.c 2003/07/20 14:24:13
@@ -488,6 +488,10 @@ decode_options (unsigned int argc, const
flag_crossjumping = 1;
flag_if_conversion = 1;
flag_if_conversion2 = 1;
+ flag_tree_ccp = 1;
+ flag_tree_dce = 1;
+ flag_tree_copyprop = 1;
+ flag_tree_dom = 1;
}
if (optimize >= 2)
@@ -512,6 +516,11 @@ decode_options (unsigned int argc, const
flag_delete_null_pointer_checks = 1;
flag_reorder_blocks = 1;
flag_reorder_functions = 1;
+ /* FIXME: Apparently, dominator optimizations get in the way of
+ SSA-PRE. For now, if -ftree-pre is given, disable dominator
+ optimizations at -O2 and higher. */
+ if (flag_tree_pre)
+ flag_tree_dom = 0;
}
if (optimize >= 3)
@@ -901,6 +910,19 @@ common_handle_option (size_t scode, cons
return 0;
break;
+ case OPT_fdisable_gimple:
+ flag_disable_gimple = value;
+ break;
+
+ case OPT_fdisable_tree_ssa:
+ flag_disable_tree_ssa = value;
+ break;
+
+ case OPT_fdump_:
+ if (!dump_switch_p (arg))
+ return 0;
+ break;
+
case OPT_fdump_unnumbered:
flag_dump_unnumbered = value;
break;
@@ -1060,6 +1082,10 @@ common_handle_option (size_t scode, cons
flag_move_all_movables = value;
break;
+ case OPT_fmudflap:
+ flag_mudflap = value;
+ break;
+
case OPT_fnew_ra:
flag_new_regalloc = value;
break;
@@ -1309,6 +1335,44 @@ common_handle_option (size_t scode, cons
flag_trapv = value;
break;
+ case OPT_ftree_ccp:
+ flag_tree_ccp = value;
+ break;
+
+ case OPT_ftree_copyprop:
+ flag_tree_copyprop = value;
+ break;
+
+ case OPT_ftree_dce:
+ flag_tree_dce = value;
+ break;
+
+ case OPT_ftree_dominator_opts:
+ flag_tree_dom = value;
+ break;
+
+ case OPT_ftree_must_alias:
+ flag_tree_must_alias = value;
+ break;
+
+ case OPT_ftree_points_to_:
+ if (!strcmp (arg, "andersen"))
+#ifdef HAVE_BANSHEE
+ flag_tree_points_to = PTA_ANDERSEN;
+#else
+ warning ("Andersen's PTA not available - libbanshee not compiled.");
+#endif
+ else
+ {
+ warning ("`%s`: unknown points-to analysis algorithm", arg);
+ return 0;
+ }
+ break;
+
+ case OPT_ftree_pre:
+ flag_tree_pre = value;
+ break;
+
case OPT_funit_at_a_time:
flag_unit_at_a_time = value;
break;
--- toplev.c 2003/07/16 22:27:12 1.1
+++ toplev.c 2003/07/17 01:54:49
@@ -964,9 +964,6 @@ enum pta_type flag_tree_points_to = PTA_
/* Enable SSA-CCP on trees. */
int flag_tree_ccp = 0;
-/* Enable SSA-CP on trees. */
-int flag_tree_cp = 0;
-
/* Enable SSA-Copy propagation on trees. */
int flag_tree_copyprop;
--- tree-cfg.c 2003/07/16 22:27:12 1.1
+++ tree-cfg.c 2003/07/18 01:09:12
@@ -107,6 +107,8 @@ static inline bool stmt_starts_bb_p (tre
static inline bool stmt_ends_bb_p (tree);
static void find_contained_blocks (tree *, bitmap, tree **);
static void compute_reachable_eh (tree);
+static int tree_verify_flow_info (void);
+static basic_block tree_make_forwarder_block (basic_block, int, int, edge, int);
/* Flowgraph optimization and cleanup. */
static void remove_unreachable_blocks (void);
@@ -190,6 +192,21 @@ static tree_stmt_iterator find_insert_lo
at line 6, it sets NEXT_BLOCK_LINK (s3) to 's4'. */
#define NEXT_BLOCK_LINK(STMT) TREE_CHAIN (STMT)
+/* FIXME These need to be filled in with appropriate pointers. But this
+ implies an ABI change in some functions. */
+struct cfg_hooks tree_cfg_hooks = {
+ tree_verify_flow_info,
+ NULL, /* dump_bb */
+ NULL, /* create_basic_block */
+ NULL, /* redirect_edge_and_branch */
+ NULL, /* redirect_edge_and_branch_force */
+ NULL, /* delete_basic_block */
+ NULL, /* split_block */
+ NULL, /* can_merge_blocks_p */
+ NULL, /* merge_blocks */
+ tree_split_edge, /* cfgh_split_edge */
+ tree_make_forwarder_block /* cfgh_make_forward_block */
+};
/*---------------------------------------------------------------------------
Create basic blocks
@@ -4752,9 +4776,77 @@ tree_split_edge (edge edge_in)
}
-/* Verifies that the flow information is ok. */
+/* Verifies that the flow information is OK. */
-void
+static int
tree_verify_flow_info (void)
{
+ return 0;
+}
+
+
+/* Split BB into entry part and rest; if REDIRECT_LATCH, redirect edges
+ marked as latch into entry part, analogically for REDIRECT_NONLATCH.
+ In both of these cases, ignore edge EXCEPT. If CONN_LATCH, set edge
+ between created entry part and BB as latch one. Return created entry
+ part. */
+
+static basic_block
+tree_make_forwarder_block (basic_block bb, int redirect_latch,
+ int redirect_nonlatch, edge except, int conn_latch)
+{
+ edge e, next_e, fallthru;
+ basic_block dummy;
+
+ /* Create the new basic block. */
+ dummy = create_bb ();
+ alloc_aux_for_block (dummy, sizeof (struct bb_ann_d));
+ dummy->count = bb->count;
+ dummy->frequency = bb->frequency;
+ dummy->loop_depth = bb->loop_depth;
+ dummy->head_tree_p = NULL;
+ dummy->end_tree_p = NULL;
+
+ /* Redirect the incoming edges. */
+ dummy->pred = bb->pred;
+ bb->pred = NULL;
+ for (e = dummy->pred; e; e = e->pred_next)
+ e->dest = dummy;
+
+ fallthru = make_edge (dummy, bb, 0);
+
+ HEADER_BLOCK (dummy) = 0;
+ HEADER_BLOCK (bb) = 1;
+
+ /* Redirect back edges we want to keep. */
+ for (e = dummy->pred; e; e = next_e)
+ {
+ next_e = e->pred_next;
+ if (e == except
+ || !((redirect_latch && LATCH_EDGE (e))
+ || (redirect_nonlatch && !LATCH_EDGE (e))))
+ {
+ dummy->frequency -= EDGE_FREQUENCY (e);
+ dummy->count -= e->count;
+ if (dummy->frequency < 0)
+ dummy->frequency = 0;
+ if (dummy->count < 0)
+ dummy->count = 0;
+ redirect_edge_succ (e, bb);
+ }
+ }
+
+ alloc_aux_for_edge (fallthru, sizeof (int));
+ LATCH_EDGE (fallthru) = conn_latch;
+
+ return dummy;
+}
+
+/* Initialization of functions specific to the tree IR. */
+
+void
+tree_register_cfg_hooks ()
+{
+ cfg_level = AT_TREE_LEVEL;
+ cfg_hooks = &tree_cfg_hooks;
}
--- tree-inline.c 2003/07/16 22:27:12 1.1
+++ tree-inline.c 2003/07/17 23:21:30
@@ -537,6 +537,7 @@ initialize_inlined_parameters (id, args,
tree a;
tree p;
tree vars = NULL_TREE;
+ bool gimplify_init_stmts_p = false;
/* Figure out what the parameters are. */
parms = DECL_ARGUMENTS (fn);
@@ -634,12 +635,19 @@ initialize_inlined_parameters (id, args,
the argument to the proper type in case it was promoted. */
if (value)
{
+ tree rhs = convert (TREE_TYPE (var), value);
+
/* We want to use MODIFY_EXPR, not INIT_EXPR here so that we
keep our trees in gimple form. */
- init_stmt = build (MODIFY_EXPR, TREE_TYPE (var), var,
- convert (TREE_TYPE (var), value));
+ init_stmt = build (MODIFY_EXPR, TREE_TYPE (var), var, rhs);
init_stmts = add_stmt_to_compound (init_stmts, void_type_node,
init_stmt);
+
+ /* If the conversion needed to assign VALUE to VAR is not a
+ GIMPLE expression, flag that we will need to gimplify
+ INIT_STMTS at the end. */
+ if (!is_gimple_rhs (rhs))
+ gimplify_init_stmts_p = true;
}
#if 0
@@ -671,6 +679,10 @@ initialize_inlined_parameters (id, args,
value);
}
+ if (gimplify_init_stmts_p
+ && keep_function_tree_in_gimple_form (fn))
+ gimplify_body (&init_stmts, fn);
+
add_var_to_bind_expr (bind_expr, vars);
return init_stmts;
}
--- tree-mudflap.c 2003/07/16 22:27:12 1.1
+++ tree-mudflap.c 2003/07/18 01:09:13
@@ -1303,7 +1304,8 @@ mudflap_enqueue_decl (tree obj, const ch
found_p = 1;
if (found_p)
- warning ("mudflap cannot track lifetime of `%D'", obj);
+ warning ("mudflap cannot track lifetime of `%s'",
+ IDENTIFIER_POINTER (DECL_NAME (obj)));
else
{
VARRAY_PUSH_TREE (deferred_static_decls, obj);
--- tree-simple.h 2003/07/16 22:27:12 1.1
+++ tree-simple.h 2003/07/17 22:51:26
@@ -88,6 +88,7 @@ typedef enum fallback_t {
} fallback_t;
int gimplify_expr (tree *, tree *, tree *, int (*) (tree), fallback_t);
int gimplify_stmt (tree *);
+int gimplify_body (tree *, tree);
/* Miscellaneous helpers. */
tree get_base_symbol (tree);