Hi all,

As the simple PR says we should call va_end before returning early from a function that started processing the va_list with va_start.
The C spec agrees:
"Each invocation of the va_start and va_copy macros
shall be matched by a corresponding invocation of the va_end macro in the same
function."

Tested arm-none-eabi.

Ok for trunk?

Thanks,
Kyrill

2014-01-16  Kyrylo Tkachov  <kyrylo.tkac...@arm.com>

    PR target/62066
    * config/arm/arm-builtins.c (arm_expand_neon_args): Call va_end before
    early return 0.
commit 6fe721142f9bbdd288a0d799e2d2d748899c06dc
Author: Kyrylo Tkachov <kyrylo.tkac...@arm.com>
Date:   Wed Jan 14 16:06:00 2015 +0000

    [ARM] PR 62066: Call va_end in arm_expand_neon_args

diff --git a/gcc/config/arm/arm-builtins.c b/gcc/config/arm/arm-builtins.c
index 739369d..8268aa0 100644
--- a/gcc/config/arm/arm-builtins.c
+++ b/gcc/config/arm/arm-builtins.c
@@ -2049,7 +2049,10 @@ arm_expand_neon_args (rtx target, machine_mode map_mode, int fcode,
             case NEON_ARG_MEMORY:
 	      /* Check if expand failed.  */
 	      if (op[argc] == const0_rtx)
+	      {
+		va_end (ap);
 		return 0;
+	      }
 	      gcc_assert (MEM_P (op[argc]));
 	      PUT_MODE (op[argc], mode[argc]);
 	      /* ??? arm_neon.h uses the same built-in functions for signed

Reply via email to