summaryrefslogtreecommitdiff
path: root/gcc/integrate.c
diff options
context:
space:
mode:
authorJeff Law <law@gcc.gnu.org>1998-04-04 06:32:39 -0700
committerJeff Law <law@gcc.gnu.org>1998-04-04 06:32:39 -0700
commite5e809f4194e578b5fbd48fc5a1df2377f28d197 (patch)
tree6743f11e58bd7a933b08900d973d89026cd11c43 /gcc/integrate.c
parent31031eddacda46a500b2390f52cd4474bcaf84ca (diff)
downloadgcc-e5e809f4194e578b5fbd48fc5a1df2377f28d197.tar.gz
* Check in merge from gcc2. See ChangeLog.11 and ChangeLog.12
for details. * haifa-sched.c: Mirror recent changes from gcc2. From-SVN: r18984
Diffstat (limited to 'gcc/integrate.c')
-rw-r--r--gcc/integrate.c62
1 files changed, 40 insertions, 22 deletions
diff --git a/gcc/integrate.c b/gcc/integrate.c
index cde8b6f3e7d..ea1acc4161b 100644
--- a/gcc/integrate.c
+++ b/gcc/integrate.c
@@ -82,13 +82,13 @@ static void set_block_abstract_flags PROTO((tree, int));
void set_decl_abstract_flags PROTO((tree, int));
/* Returns the Ith entry in the label_map contained in MAP. If the
- Ith entry has not yet been set, it is assumed to be a fresh label.
- Essentially, we use this function to perform a lazy initialization
- of label_map, thereby avoiding huge memory explosions when the
- label_map gets very large. */
+ Ith entry has not yet been set, return a fresh label. This function
+ performs a lazy initialization of label_map, thereby avoiding huge memory
+ explosions when the label_map gets very large. */
+
rtx
get_label_from_map (map, i)
- struct inline_remap* map;
+ struct inline_remap *map;
int i;
{
rtx x = map->label_map[i];
@@ -99,7 +99,6 @@ get_label_from_map (map, i)
return x;
}
-
/* Zero if the current function (whose FUNCTION_DECL is FNDECL)
is safe and reasonable to integrate into other functions.
Nonzero means value is a warning message with a single %s
@@ -116,9 +115,7 @@ function_cannot_inline_p (fndecl)
register tree parms;
rtx result;
- /* No inlines with varargs. `grokdeclarator' gives a warning
- message about that if `inline' is specified. This code
- it put in to catch the volunteers. */
+ /* No inlines with varargs. */
if ((last && TREE_VALUE (last) != void_type_node)
|| current_function_varargs)
return "varargs function cannot be inline";
@@ -298,6 +295,7 @@ initialize_for_inline (fndecl, min_labelno, max_labelno, max_reg, copy)
parms = TREE_CHAIN (parms), i++)
{
rtx p = DECL_RTL (parms);
+ int copied_incoming = 0;
/* If we have (mem (addressof (mem ...))), use the inner MEM since
otherwise the copy_rtx call below will not unshare the MEM since
@@ -320,7 +318,8 @@ initialize_for_inline (fndecl, min_labelno, max_labelno, max_reg, copy)
&& GET_CODE (DECL_INCOMING_RTL (parms)) == MEM
&& (XEXP (DECL_RTL (parms), 0)
== XEXP (DECL_INCOMING_RTL (parms), 0))))
- DECL_INCOMING_RTL (parms) = new;
+ DECL_INCOMING_RTL (parms) = new, copied_incoming = 1;
+
DECL_RTL (parms) = new;
}
@@ -342,6 +341,23 @@ initialize_for_inline (fndecl, min_labelno, max_labelno, max_reg, copy)
/* This flag is cleared later
if the function ever modifies the value of the parm. */
TREE_READONLY (parms) = 1;
+
+ /* Copy DECL_INCOMING_RTL if not done already. This can
+ happen if DECL_RTL is a reg. */
+ if (copy && ! copied_incoming)
+ {
+ p = DECL_INCOMING_RTL (parms);
+
+ /* If we have (mem (addressof (mem ...))), use the inner MEM since
+ otherwise the copy_rtx call below will not unshare the MEM since
+ it shares ADDRESSOF. */
+ if (GET_CODE (p) == MEM && GET_CODE (XEXP (p, 0)) == ADDRESSOF
+ && GET_CODE (XEXP (XEXP (p, 0), 0)) == MEM)
+ p = XEXP (XEXP (p, 0), 0);
+
+ if (GET_CODE (p) == MEM)
+ DECL_INCOMING_RTL (parms) = copy_rtx (p);
+ }
}
/* Assume we start out in the insns that set up the parameters. */
@@ -1423,7 +1439,7 @@ expand_inline_function (fndecl, parms, target, ignore, type,
arg_vals[i] = copy_to_mode_reg (GET_MODE (loc), arg_vals[i]);
if (arg_vals[i] != 0 && GET_CODE (arg_vals[i]) == REG
- && TREE_CODE (TREE_TYPE (formal)) == POINTER_TYPE)
+ && POINTER_TYPE_P (TREE_TYPE (formal)))
mark_reg_pointer (arg_vals[i],
(TYPE_ALIGN (TREE_TYPE (TREE_TYPE (formal)))
/ BITS_PER_UNIT));
@@ -1790,9 +1806,10 @@ expand_inline_function (fndecl, parms, target, ignore, type,
pushlevel (0);
expand_start_bindings (0);
- /* Make new label equivalences for the labels in the called function. */
- for (i = min_labelno; i < max_labelno; i++)
- map->label_map[i] = NULL_RTX;
+ /* Initialize label_map. get_label_from_map will actually make
+ the labels. */
+ bzero ((char *) &map->label_map [min_labelno],
+ (max_labelno - min_labelno) * sizeof (rtx));
/* Perform postincrements before actually calling the function. */
emit_queue ();
@@ -1991,9 +2008,8 @@ expand_inline_function (fndecl, parms, target, ignore, type,
break;
case CODE_LABEL:
- copy =
- emit_label (get_label_from_map(map,
- CODE_LABEL_NUMBER (insn)));
+ copy = emit_label (get_label_from_map (map,
+ CODE_LABEL_NUMBER (insn)));
LABEL_NAME (copy) = LABEL_NAME (insn);
map->const_age++;
break;
@@ -2012,12 +2028,14 @@ expand_inline_function (fndecl, parms, target, ignore, type,
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_FUNCTION_BEG
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED)
{
- copy = emit_note (NOTE_SOURCE_FILE (insn), NOTE_LINE_NUMBER (insn));
- if (copy && (NOTE_LINE_NUMBER (copy) == NOTE_INSN_EH_REGION_BEG
- || NOTE_LINE_NUMBER (copy) == NOTE_INSN_EH_REGION_END))
+ copy = emit_note (NOTE_SOURCE_FILE (insn),
+ NOTE_LINE_NUMBER (insn));
+ if (copy
+ && (NOTE_LINE_NUMBER (copy) == NOTE_INSN_EH_REGION_BEG
+ || NOTE_LINE_NUMBER (copy) == NOTE_INSN_EH_REGION_END))
{
- rtx label =
- get_label_from_map (map, NOTE_BLOCK_NUMBER (copy));
+ rtx label
+ = get_label_from_map (map, NOTE_BLOCK_NUMBER (copy));
/* We have to forward these both to match the new exception
region. */