From: Martin Liska Date: Tue, 14 Feb 2017 08:03:42 +0000 (+0100) Subject: Replace XALLOCAVEC with XCNEWVEC (PR c/79471). X-Git-Tag: releases/gcc-5.5.0~526 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=40f667a96c13dbd19d1a88c42b0cb91ef3ff268d;p=thirdparty%2Fgcc.git Replace XALLOCAVEC with XCNEWVEC (PR c/79471). 2017-02-14 Martin Liska Backport from mainline 2017-02-13 Martin Liska PR c/79471 * calls.c (expand_call): Replace XALLOCAVEC with XCNEWVEC. From-SVN: r245418 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6dbad39c5d45..1f02d717b6be 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2017-02-14 Martin Liska + + Backport from mainline + 2017-02-13 Martin Liska + + PR c/79471 + * calls.c (expand_call): Replace XALLOCAVEC with XCNEWVEC. + 2017-02-08 Segher Boessenkool PR translation/79397 diff --git a/gcc/calls.c b/gcc/calls.c index 29b4ed18cec7..d51d5aea0cc8 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -2705,8 +2705,7 @@ expand_call (tree exp, rtx target, int ignore) n_named_args = num_actuals; /* Make a vector to hold all the information about each arg. */ - args = XALLOCAVEC (struct arg_data, num_actuals); - memset (args, 0, num_actuals * sizeof (struct arg_data)); + args = XCNEWVEC (struct arg_data, num_actuals); /* Build up entries in the ARGS array, compute the size of the arguments into ARGS_SIZE, etc. */ @@ -3719,6 +3718,7 @@ expand_call (tree exp, rtx target, int ignore) currently_expanding_call--; free (stack_usage_map_buf); + free (args); /* Join result with returned bounds so caller may use them if needed. */ target = chkp_join_splitted_slot (target, valbnd);