replace free variables: replacements from va_list
This follows issue #1
The free variables replacer is injecting in the EMI blocks variables from the va_list.
Original:
typedef __builtin_va_list __gnuc_va_list;
typedef __gnuc_va_list va_list;
f (int n, ...)
{
va_list args;
__builtin_va_start(args,n);
if (__builtin_va_arg(args,int) != 10) {
abort ();
}
if (__builtin_va_arg(args,long long) != 10000000000LL) {
abort ();
}
And some of the replacements are like
uint32_emi_t *__EMI__g_1603 = &args.fp_offset[0];
Then there are errors like
In file included from /home/gj/tmp/gcc.c-torture_execute_va-arg-6/variant_0.c:43:
/home/gj/tmp/gcc.c-torture_execute_va-arg-6/variant_0_sinjection_2.h:179:37: error: member reference
base type 'va_list' (aka '__builtin_va_list') is not a structure or union
uint32_emi_t *__EMI__g_1603 = &args.fp_offset[0];
~~~~^~~~~~~~~~
In fact va_list is not exactly a structure (although the compiler might expand it to a structure), but it's define in the standard headers as in this way: https://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-4.2/cstdarg-source.html
Furthermore the GCC testuiste uses a GNU variant of va_list va_start va_arg which I don't know much about.
I think that it would be better to disable getting replacements from a va_list
Program run information:
Checking fail:
/home/gj/metamorphicCL/metamorphiccl/python/mmc_generate.py /home/gj/ocl/gcctestsuite/generic-c99/gcc.c-torture_execute_va-arg-6.c -o /home/gj/tmp/gcc.c-torture_execute_va-arg-6 --num-variants 2 --seed 471799 --percentageDead 15 --percentageExpr 10 --percentageGoto 20 --percentageSwitch 30
####
/home/gj/metamorphicCL/metamorphiccl/python/mmc_check.py --dir /home/gj/tmp/gcc.c-torture_execute_va-arg-6 --cc gcc
List of tests that fail due to va_list:
gcc.c-torture_execute_va-arg-6.c
gcc.c-torture_execute_va-arg-11.c
gcc.c-torture_execute_va-arg-23.c
gcc.c-torture_execute_va-arg-24.c