aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1997-07-27 19:35:23 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1997-07-27 19:35:23 -0400
commitd0977240cb11d81e95dc263820ae177c27d9c059 (patch)
tree87b2dc4440427d402a6f48a14b07aa681e2aaf6a /gcc
parent4ac74fb88fb66c14da983ea9599f31b1e15c3fdf (diff)
downloadgcc-d0977240cb11d81e95dc263820ae177c27d9c059.zip
gcc-d0977240cb11d81e95dc263820ae177c27d9c059.tar.gz
gcc-d0977240cb11d81e95dc263820ae177c27d9c059.tar.bz2
(expand_expr, case LABEL_DECL): Treat inline_function_decl like current_function_decl.
(expand_expr, case LABEL_DECL): Treat inline_function_decl like current_function_decl. (expand_expr, case SAVE_EXPR): Handle top-level SVAE_EXPR by moving into current function; abort if in incorrect context. From-SVN: r14540
Diffstat (limited to 'gcc')
-rw-r--r--gcc/expr.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 0feb691..41deddf 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -4730,7 +4730,8 @@ expand_expr (exp, target, tmode, modifier)
{
tree function = decl_function_context (exp);
/* Handle using a label in a containing function. */
- if (function != current_function_decl && function != 0)
+ if (function != current_function_decl
+ && function != inline_function_decl && function != 0)
{
struct function *p = find_function_data (function);
/* Allocate in the memory associated with the function
@@ -4747,7 +4748,8 @@ expand_expr (exp, target, tmode, modifier)
label_rtx (exp), forced_labels);
temp = gen_rtx (MEM, FUNCTION_MODE,
gen_rtx (LABEL_REF, Pmode, label_rtx (exp)));
- if (function != current_function_decl && function != 0)
+ if (function != current_function_decl
+ && function != inline_function_decl && function != 0)
LABEL_REF_NONLOCAL_P (XEXP (temp, 0)) = 1;
return temp;
}
@@ -4924,6 +4926,11 @@ expand_expr (exp, target, tmode, modifier)
case SAVE_EXPR:
context = decl_function_context (exp);
+ /* If this SAVE_EXPR was at global context, assume we are an
+ initialization function and move it into our context. */
+ if (context == 0)
+ SAVE_EXPR_CONTEXT (exp) = current_function_decl;
+
/* We treat inline_function_decl as an alias for the current function
because that is the inline function whose vars, types, etc.
are being merged into the current function.
@@ -4934,6 +4941,10 @@ expand_expr (exp, target, tmode, modifier)
/* If this is non-local, handle it. */
if (context)
{
+ /* The following call just exists to abort if the context is
+ not of a containing function. */
+ find_function_data (context);
+
temp = SAVE_EXPR_RTL (exp);
if (temp && GET_CODE (temp) == REG)
{