Commit 046e4e36 by Zack Weinberg

stmt.c (force_label_rtx): New function, based on logic formerly found in expand_expr.

	* stmt.c (force_label_rtx): New function, based on logic
	formerly found in expand_expr.
	* expr.h: Prototype it.
	* expr.c (expand_expr <LABEL_DECL>): Use force_label_rtx if
	appropriate.
	* varasm.c (decode_addr_const <LABEL_DECL>): Use force_label_rtx.

	* print-tree.c (debug_tree): Free the table after we're done
	with it.  Use putc.

treelang:
	* Make-lang.in: Set -Wno-error for treelang/lex.o.

From-SVN: r66579
parent 9d70d418
2003-05-07 Zack Weinberg <zack@codesourcery.com>
* stmt.c (force_label_rtx): New function, based on logic
formerly found in expand_expr.
* expr.h: Prototype it.
* expr.c (expand_expr <LABEL_DECL>): Use force_label_rtx if
appropriate.
* varasm.c (decode_addr_const <LABEL_DECL>): Use force_label_rtx.
* print-tree.c (debug_tree): Free the table after we're done
with it. Use putc.
2003-05-07 Aldy Hernandez <aldyh@redhat.com>
* config/rs6000/spe.h: Reverse arguments for __ev_subfw.
Unreverse arguments for __ev_subw.
* config/rs6000/spe.h: Reverse arguments for __ev_subfw.
Unreverse arguments for __ev_subw.
* config/rs6000/spe.md (evsubfw): Reverse arguments of assembly.
* config/rs6000/spe.md (evsubfw): Reverse arguments of assembly.
2003-05-07 Nick Clifton <nickc@redhat.com>
......@@ -69,13 +81,13 @@
2003-05-06 Aldy Hernandez <aldyh@redhat.com>
* config/rs6000/linuxspe.h: New file.
* config/rs6000/linuxspe.h: New file.
* config.gcc: Add powerpc-*-linux-gnuspe* target.
* config.gcc: Add powerpc-*-linux-gnuspe* target.
2003-05-06 Richard Henderson <rth@redhat.com>
* unwind-dw2.c (uw_update_context_1): Only set cfa as sp if
* unwind-dw2.c (uw_update_context_1): Only set cfa as sp if
previous frame didn't save sp. Clear sp for next frame.
(uw_install_context_1): Honor saved sp from frame.
......
......@@ -6753,25 +6753,17 @@ expand_expr (exp, target, tmode, modifier)
case LABEL_DECL:
{
tree function = decl_function_context (exp);
/* Handle using a label in a containing function. */
if (function != current_function_decl
&& function != inline_function_decl && function != 0)
{
struct function *p = find_function_data (function);
p->expr->x_forced_labels
= gen_rtx_EXPR_LIST (VOIDmode, label_rtx (exp),
p->expr->x_forced_labels);
}
/* Labels in containing functions, or labels used from initializers,
must be forced. */
if (modifier == EXPAND_INITIALIZER
|| (function != current_function_decl
&& function != inline_function_decl
&& function != 0))
temp = force_label_rtx (exp);
else
{
if (modifier == EXPAND_INITIALIZER)
forced_labels = gen_rtx_EXPR_LIST (VOIDmode,
label_rtx (exp),
forced_labels);
}
temp = label_rtx (exp);
temp = gen_rtx_MEM (FUNCTION_MODE,
gen_rtx_LABEL_REF (Pmode, label_rtx (exp)));
temp = gen_rtx_MEM (FUNCTION_MODE, gen_rtx_LABEL_REF (Pmode, temp));
if (function != current_function_decl
&& function != inline_function_decl && function != 0)
LABEL_REF_NONLOCAL_P (XEXP (temp, 0)) = 1;
......
......@@ -595,6 +595,11 @@ extern rtx expand_inline_function PARAMS ((tree, tree, rtx, int, tree, rtx));
/* Return the CODE_LABEL rtx for a LABEL_DECL, creating it if necessary. */
extern rtx label_rtx PARAMS ((tree));
/* As label_rtx, but additionally the label is placed on the forced label
list of its containing function (i.e. it is treated as reachable even
if how is not obvious). */
extern rtx force_label_rtx PARAMS ((tree));
#endif
/* Indicate how an input argument register was promoted. */
......
......@@ -52,8 +52,9 @@ debug_tree (node)
{
table = (struct bucket **) xcalloc (HASH_SIZE, sizeof (struct bucket *));
print_node (stderr, "", node, 0);
free (table);
table = 0;
fprintf (stderr, "\n");
putc ('\n', stderr);
}
/* Print a node in brief fashion, with just the code, address and name. */
......
......@@ -510,6 +510,29 @@ label_rtx (label)
return DECL_RTL (label);
}
/* As above, but also put it on the forced-reference list of the
function that contains it. */
rtx
force_label_rtx (label)
tree label;
{
rtx ref = label_rtx (label);
tree function = decl_function_context (label);
struct function *p;
if (!function)
abort ();
if (function != current_function_decl
&& function != inline_function_decl)
p = find_function_data (function);
else
p = cfun;
p->expr->x_forced_labels = gen_rtx_EXPR_LIST (VOIDmode, ref,
p->expr->x_forced_labels);
return ref;
}
/* Add an unconditional jump to LABEL as the next sequential instruction. */
......
2003-05-07 Zack Weinberg <zack@codesourcery.com>
* Make-lang.in: Set -Wno-error for treelang/lex.o.
2003-05-06 Nathan Sidwell <nathan@codesourcery.com>
* Make-lang.in (treelang/tree1.o): Depends on input.h
......@@ -91,7 +95,7 @@
2003-03-01 Tim Josling <tej@melbpc.org.au>
Name clashes with rtl.h fixed.
Name clashes with rtl.h fixed.
* lex.l: Tokens PLUS, MINUS, RETURN changed to tl_PLUS tl_MINUS
tl_RETURN.
......@@ -108,7 +112,7 @@
2003-02-23 Tim Josling <tej@melbpc.org.au>
Fix garbage collection, add more error checking, force GC always.
Fix garbage collection, add more error checking, force GC always.
* Make-lang.in (treelang/tree1.o): Depend on treelang/treetree.h
(treelang/treetree.o): Depend on treelang/parse.h
......
......@@ -67,6 +67,8 @@ TREE_EXES = tree1$(exeext)
treelang-warn = $(LOOSE_WARN) -pedantic -Wno-long-long -Wmissing-prototypes -Wmissing-declarations $(WERROR)
# bison emits some unused static arrays (yytoknum)
treelang/parse.o-warn = -Wno-error
# flex produces 'no previous prototype' warnings
treelang/lex.o-warn = -Wno-error
#
# Define the names for selecting treelang in LANGUAGES.
......
......@@ -2088,8 +2088,7 @@ decode_addr_const (exp, value)
case LABEL_DECL:
x = gen_rtx_MEM (FUNCTION_MODE,
gen_rtx_LABEL_REF (VOIDmode,
label_rtx (TREE_OPERAND (exp, 0))));
gen_rtx_LABEL_REF (VOIDmode, force_label_rtx (target)));
break;
case REAL_CST:
......
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