diff options
author | Mark Mitchell <mark@markmitchell.com> | 1999-01-07 11:29:38 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1999-01-07 04:29:38 -0700 |
commit | 8e6a59feebbfbedc620983ca9a568efebf016a48 (patch) | |
tree | 7c5f130f91ec25adc7b64b5a91dd19084554401c /gcc | |
parent | 5e1db167b77b3f96157c18fc3c879c28b329f911 (diff) | |
download | gcc-8e6a59feebbfbedc620983ca9a568efebf016a48.zip gcc-8e6a59feebbfbedc620983ca9a568efebf016a48.tar.gz gcc-8e6a59feebbfbedc620983ca9a568efebf016a48.tar.bz2 |
calls.c (store_unaligned_arguments_into_pseudos): Use xmalloc to allocate memory that will live beyond this function.
* calls.c (store_unaligned_arguments_into_pseudos): Use xmalloc to
allocate memory that will live beyond this function.
(expand_call): Free it here.
From-SVN: r24561
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/calls.c | 16 |
2 files changed, 19 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5493f51..a71ab6e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +Thu Jan 7 11:26:17 1999 Mark Mitchell <mark@markmitchell.com> + + * calls.c (store_unaligned_arguments_into_pseudos): Use xmalloc to + allocate memory that will live beyond this function. + (expand_call): Free it here. + Thu Jan 7 03:08:17 1999 Richard Henderson <rth@cygnus.com> * sparc.h (PREFERRED_RELOAD_CLASS): Select GENERAL_REGS for diff --git a/gcc/calls.c b/gcc/calls.c index b180758..b41158e 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -753,7 +753,12 @@ restore_fixed_argument_area (save_area, argblock, high_to_save, low_to_save) /* If any elements in ARGS refer to parameters that are to be passed in registers, but not in memory, and whose alignment does not permit a direct copy into registers. Copy the values into a group of pseudos - which we will later copy into the appropriate hard registers. */ + which we will later copy into the appropriate hard registers. + + Pseudos for each unaligned argument will be stored into the array + args[argnum].aligned_regs. The caller is responsible for deallocating + the aligned_regs array if it is nonzero. */ + static void store_unaligned_arguments_into_pseudos (args, num_actuals) struct arg_data *args; @@ -774,8 +779,8 @@ store_unaligned_arguments_into_pseudos (args, num_actuals) = args[i].partial ? args[i].partial : (bytes + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD; - args[i].aligned_regs = (rtx *) alloca (sizeof (rtx) - * args[i].n_aligned_regs); + args[i].aligned_regs = (rtx *) xmalloc (sizeof (rtx) + * args[i].n_aligned_regs); /* Structures smaller than a word are aligned to the least significant byte (to the right). On a BYTES_BIG_ENDIAN machine, @@ -2298,6 +2303,11 @@ expand_call (exp, target, ignore) pop_temp_slots (); + /* Free up storage we no longer need. */ + for (i = 0; i < num_actuals; ++i) + if (args[i].aligned_regs) + free (args[i].aligned_regs); + return target; } |