Patchwork Fix number of arguments in call to alloca_with_align

login
register
mail settings
Submitter Tom de Vries
Date Oct. 12, 2011, 7:24 p.m.
Message ID <4E95E97E.2060804@mentor.com>
Download mbox | patch
Permalink /patch/119285/
State New
Headers show

Comments

Tom de Vries - Oct. 12, 2011, 7:24 p.m.
Richard,

This patch fixes a trivial problem in gimplify_parameters, introduced by the
patch that introduced BUILT_IN_ALLOCA_WITH_ALIGN.
BUILT_IN_ALLOCA_WITH_ALIGN has 2 parameters, so the number of arguments in the
corresponding build_call_expr should be 2, not 1.

Bootstrapped and reg-tested (including Ada) on x86_64.

OK for trunk?

Thanks,
- Tom


2011-10-12  Tom de Vries  <tom@codesourcery.com>

	* function.c (gimplify_parameters): Set number of arguments of call to
	BUILT_IN_ALLOCA_WITH_ALIGN to 2.
Richard Guenther - Oct. 13, 2011, 9:04 a.m.
On Wed, Oct 12, 2011 at 9:24 PM, Tom de Vries <Tom_deVries@mentor.com> wrote:
> Richard,
>
> This patch fixes a trivial problem in gimplify_parameters, introduced by the
> patch that introduced BUILT_IN_ALLOCA_WITH_ALIGN.
> BUILT_IN_ALLOCA_WITH_ALIGN has 2 parameters, so the number of arguments in the
> corresponding build_call_expr should be 2, not 1.
>
> Bootstrapped and reg-tested (including Ada) on x86_64.
>
> OK for trunk?

Yes.  Qualifies as obvious anyway ;)

Thanks,
Richard.


> Thanks,
> - Tom
>
>
> 2011-10-12  Tom de Vries  <tom@codesourcery.com>
>
>        * function.c (gimplify_parameters): Set number of arguments of call to
>        BUILT_IN_ALLOCA_WITH_ALIGN to 2.
>

Patch

Index: gcc/function.c
===================================================================
--- gcc/function.c (revision 179773)
+++ gcc/function.c (working copy)
@@ -3636,7 +3636,7 @@  gimplify_parameters (void)
 		  local = build_fold_indirect_ref (addr);
 
 		  t = built_in_decls[BUILT_IN_ALLOCA_WITH_ALIGN];
-		  t = build_call_expr (t, 1, DECL_SIZE_UNIT (parm),
+		  t = build_call_expr (t, 2, DECL_SIZE_UNIT (parm),
 				       size_int (DECL_ALIGN (parm)));
 
 		  /* The call has been built for a variable-sized object.  */