summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2003-05-07 21:14:48 +0000
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2003-05-07 21:14:48 +0000
commit78a75ebdcef7a63f4bb95ef39795a99ed1d9786a (patch)
tree3614f193205349c343ee4e569d08b222253384a4 /gcc
parent24bfa2345430b739a614f7d2949bd3b5c62bb26f (diff)
downloadgcc-78a75ebdcef7a63f4bb95ef39795a99ed1d9786a.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66579 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog24
-rw-r--r--gcc/expr.c26
-rw-r--r--gcc/expr.h5
-rw-r--r--gcc/print-tree.c3
-rw-r--r--gcc/stmt.c23
-rw-r--r--gcc/treelang/ChangeLog8
-rw-r--r--gcc/treelang/Make-lang.in2
-rw-r--r--gcc/varasm.c3
8 files changed, 66 insertions, 28 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 287e8a0b255..2dc768dbf07 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,9 +1,21 @@
+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.
diff --git a/gcc/expr.c b/gcc/expr.c
index 6659d61f714..9f1c330bdf1 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -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;
diff --git a/gcc/expr.h b/gcc/expr.h
index dfd83d43c23..64ee6f1225a 100644
--- a/gcc/expr.h
+++ b/gcc/expr.h
@@ -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. */
diff --git a/gcc/print-tree.c b/gcc/print-tree.c
index bb1230d24b4..b06de111456 100644
--- a/gcc/print-tree.c
+++ b/gcc/print-tree.c
@@ -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. */
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 7c94359f4aa..4beb86eea96 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -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. */
diff --git a/gcc/treelang/ChangeLog b/gcc/treelang/ChangeLog
index cd2c9c4b863..4ea22aeab8a 100644
--- a/gcc/treelang/ChangeLog
+++ b/gcc/treelang/ChangeLog
@@ -1,3 +1,7 @@
+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
diff --git a/gcc/treelang/Make-lang.in b/gcc/treelang/Make-lang.in
index 2e31fac8c73..8f3885a2daf 100644
--- a/gcc/treelang/Make-lang.in
+++ b/gcc/treelang/Make-lang.in
@@ -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.
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 1e17a069651..ec8d60149a6 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -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: