Commit f644bd14 by Jeffrey A Law Committed by Jeff Law

integrate.c (save_for_inline_copying): Avoid undefined pointer operations.

        * integrate.c (save_for_inline_copying): Avoid undefined pointer
        operations.
        (expand_inline_function): Likewise.

From-SVN: r15866
parent aa0c1401
Tue Oct 7 15:37:35 1997 Jeffrey A Law (law@cygnus.com) Tue Oct 7 15:37:35 1997 Jeffrey A Law (law@cygnus.com)
* integrate.c (save_for_inline_copying): Avoid undefined pointer
operations.
(expand_inline_function): Likewise.
* dwarf2out.c (output_call_frame_info): Reinstate last change * dwarf2out.c (output_call_frame_info): Reinstate last change
using flag_debug_asm check instead of flag_verbose_asm. using flag_debug_asm check instead of flag_verbose_asm.
......
...@@ -414,10 +414,6 @@ save_for_inline_copying (fndecl) ...@@ -414,10 +414,6 @@ save_for_inline_copying (fndecl)
rtx first_nonparm_insn; rtx first_nonparm_insn;
char *new, *new1; char *new, *new1;
/* The pointer used to track the true location of the memory used
for LABEL_MAP. */
rtx *real_label_map = 0;
/* Make and emit a return-label if we have not already done so. /* Make and emit a return-label if we have not already done so.
Do this before recording the bounds on label numbers. */ Do this before recording the bounds on label numbers. */
...@@ -519,9 +515,7 @@ save_for_inline_copying (fndecl) ...@@ -519,9 +515,7 @@ save_for_inline_copying (fndecl)
/* We used to use alloca here, but the size of what it would try to /* We used to use alloca here, but the size of what it would try to
allocate would occasionally cause it to exceed the stack limit and allocate would occasionally cause it to exceed the stack limit and
cause unpredictable core dumps. Some examples were > 2Mb in size. */ cause unpredictable core dumps. Some examples were > 2Mb in size. */
real_label_map label_map = (rtx *) xmalloc ((max_labelno) * sizeof (rtx));
= (rtx *) xmalloc ((max_labelno - min_labelno) * sizeof (rtx));
label_map = real_label_map - min_labelno;
for (i = min_labelno; i < max_labelno; i++) for (i = min_labelno; i < max_labelno; i++)
label_map[i] = gen_label_rtx (); label_map[i] = gen_label_rtx ();
...@@ -664,8 +658,8 @@ save_for_inline_copying (fndecl) ...@@ -664,8 +658,8 @@ save_for_inline_copying (fndecl)
set_new_first_and_last_insn (first_insn, last_insn); set_new_first_and_last_insn (first_insn, last_insn);
if (real_label_map) if (label_map)
free (real_label_map); free (label_map);
} }
/* Return a copy of a chain of nodes, chained through the TREE_CHAIN field. /* Return a copy of a chain of nodes, chained through the TREE_CHAIN field.
...@@ -1250,10 +1244,6 @@ expand_inline_function (fndecl, parms, target, ignore, type, ...@@ -1250,10 +1244,6 @@ expand_inline_function (fndecl, parms, target, ignore, type,
rtvec arg_vector = ORIGINAL_ARG_VECTOR (header); rtvec arg_vector = ORIGINAL_ARG_VECTOR (header);
rtx static_chain_value = 0; rtx static_chain_value = 0;
/* The pointer used to track the true location of the memory used
for MAP->LABEL_MAP. */
rtx *real_label_map = 0;
/* Allow for equivalences of the pseudos we make for virtual fp and ap. */ /* Allow for equivalences of the pseudos we make for virtual fp and ap. */
max_regno = MAX_REGNUM (header) + 3; max_regno = MAX_REGNUM (header) + 3;
if (max_regno < FIRST_PSEUDO_REGISTER) if (max_regno < FIRST_PSEUDO_REGISTER)
...@@ -1393,9 +1383,8 @@ expand_inline_function (fndecl, parms, target, ignore, type, ...@@ -1393,9 +1383,8 @@ expand_inline_function (fndecl, parms, target, ignore, type,
/* We used to use alloca here, but the size of what it would try to /* We used to use alloca here, but the size of what it would try to
allocate would occasionally cause it to exceed the stack limit and allocate would occasionally cause it to exceed the stack limit and
cause unpredictable core dumps. */ cause unpredictable core dumps. */
real_label_map label_map = (rtx *) xmalloc ((max_labelno) * sizeof (rtx));
= (rtx *) xmalloc ((max_labelno - min_labelno) * sizeof (rtx)); map->label_map = label_map;
map->label_map = real_label_map - min_labelno;
map->insn_map = (rtx *) alloca (INSN_UID (header) * sizeof (rtx)); map->insn_map = (rtx *) alloca (INSN_UID (header) * sizeof (rtx));
bzero ((char *) map->insn_map, INSN_UID (header) * sizeof (rtx)); bzero ((char *) map->insn_map, INSN_UID (header) * sizeof (rtx));
...@@ -2044,8 +2033,8 @@ expand_inline_function (fndecl, parms, target, ignore, type, ...@@ -2044,8 +2033,8 @@ expand_inline_function (fndecl, parms, target, ignore, type,
} }
/* Make sure we free the things we explicitly allocated with xmalloc. */ /* Make sure we free the things we explicitly allocated with xmalloc. */
if (real_label_map) if (label_map)
free (real_label_map); free (label_map);
return target; return target;
} }
......
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