Commit d0977240 by Richard Kenner

(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
parent 4ac74fb8
...@@ -4730,7 +4730,8 @@ expand_expr (exp, target, tmode, modifier) ...@@ -4730,7 +4730,8 @@ expand_expr (exp, target, tmode, modifier)
{ {
tree function = decl_function_context (exp); tree function = decl_function_context (exp);
/* Handle using a label in a containing function. */ /* 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); struct function *p = find_function_data (function);
/* Allocate in the memory associated with the function /* Allocate in the memory associated with the function
...@@ -4747,7 +4748,8 @@ expand_expr (exp, target, tmode, modifier) ...@@ -4747,7 +4748,8 @@ expand_expr (exp, target, tmode, modifier)
label_rtx (exp), forced_labels); label_rtx (exp), forced_labels);
temp = gen_rtx (MEM, FUNCTION_MODE, temp = gen_rtx (MEM, FUNCTION_MODE,
gen_rtx (LABEL_REF, Pmode, label_rtx (exp))); 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; LABEL_REF_NONLOCAL_P (XEXP (temp, 0)) = 1;
return temp; return temp;
} }
...@@ -4924,6 +4926,11 @@ expand_expr (exp, target, tmode, modifier) ...@@ -4924,6 +4926,11 @@ expand_expr (exp, target, tmode, modifier)
case SAVE_EXPR: case SAVE_EXPR:
context = decl_function_context (exp); 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 /* We treat inline_function_decl as an alias for the current function
because that is the inline function whose vars, types, etc. because that is the inline function whose vars, types, etc.
are being merged into the current function. are being merged into the current function.
...@@ -4934,6 +4941,10 @@ expand_expr (exp, target, tmode, modifier) ...@@ -4934,6 +4941,10 @@ expand_expr (exp, target, tmode, modifier)
/* If this is non-local, handle it. */ /* If this is non-local, handle it. */
if (context) 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); temp = SAVE_EXPR_RTL (exp);
if (temp && GET_CODE (temp) == REG) if (temp && GET_CODE (temp) == REG)
{ {
......
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