diff mbox

Replace XALLOCAVEC with XCNEWVEC (PR c/79471).

Message ID a5e74aae-6df5-330e-1a67-39eab6c83793@suse.cz
State New
Headers show

Commit Message

Martin Liška Feb. 13, 2017, 10:15 a.m. UTC
Hello.

In order to not cause a stack overflow, lets use a vector allocated on heap instead of
the one created by XALLOCVEC.

Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.

Ready to be installed?
Martin

Comments

Bernd Schmidt Feb. 13, 2017, 12:58 p.m. UTC | #1
On 02/13/2017 11:15 AM, Martin Liška wrote:
> In order to not cause a stack overflow, lets use a vector allocated on heap instead of
> the one created by XALLOCVEC.
>
> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.

Ok. I'm surprised this is marked as a regression, but it's simple enough 
that it probably ought to be fixed in any case.


Bernd
Martin Liška Feb. 13, 2017, 1:06 p.m. UTC | #2
On 02/13/2017 01:58 PM, Bernd Schmidt wrote:
> On 02/13/2017 11:15 AM, Martin Liška wrote:
>> In order to not cause a stack overflow, lets use a vector allocated on heap instead of
>> the one created by XALLOCVEC.
>>
>> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.
> 
> Ok. I'm surprised this is marked as a regression, but it's simple enough that it probably ought to be fixed in any case.

Yep. I've just removed that. Is it also fine to both active branches after it finishes regression tests?

Thanks,
Martin

> 
> 
> Bernd
Bernd Schmidt Feb. 13, 2017, 1:09 p.m. UTC | #3
On 02/13/2017 02:06 PM, Martin Liška wrote:
> On 02/13/2017 01:58 PM, Bernd Schmidt wrote:
>> On 02/13/2017 11:15 AM, Martin Liška wrote:
>>> In order to not cause a stack overflow, lets use a vector allocated on heap instead of
>>> the one created by XALLOCVEC.
>>>
>>> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.
>>
>> Ok. I'm surprised this is marked as a regression, but it's simple enough that it probably ought to be fixed in any case.
>
> Yep. I've just removed that. Is it also fine to both active branches after it finishes regression tests?

Sure.


Bernd
diff mbox

Patch

From c71fadc2104c729ae5625e06c54239998dd794a5 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Mon, 13 Feb 2017 09:25:36 +0100
Subject: [PATCH] Replace XALLOCAVEC with XCNEWVEC (PR c/79471).

gcc/ChangeLog:

2017-02-13  Martin Liska  <mliska@suse.cz>

	PR c/79471
	* calls.c (expand_call): Replace XALLOCAVEC with XCNEWVEC.
---
 gcc/calls.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/calls.c b/gcc/calls.c
index 7b45b9a111d..6d5ef4e02a0 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -3262,8 +3262,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.  */
@@ -4265,6 +4264,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);
-- 
2.11.0