GCC for Renesas RX 4.8.4.201803-GNURX-ELF toolchain issue
GCC for Renesas RX 4.8.4.201803-GNURX-ELF toolchain issue
Hello All,
I am trying to test the below mentioned code snippet, on e2 studio using rx-elf-gcc toolchain for rx65n target
rx-elf-gcc Compiler output is different from gcc output
Code Snippet:
#include <stdio.h>
typedef void (*numentry_t)(int cnt, int arg1, …);
typedef void (*numentry1_t)(int cnt, int arg1);
struct varargs_s
{
numentry_t func; /* Function to execute when delay expires */
};
struct varargs_s vararg;
void test_varargs(int count, int arg1)
{
count = arg1;
printf(“Count value is %d”, count);
}
int varargs_assign(numentry_t varentry)
{
vararg.func = varentry;
(((vararg.func)))(1, 100); /* 2nd parameter value 100 is not passed to the called function test_varargs */
((numentry1_t)(vararg.func))(1, 100); /* 2nd parameter value 100 is passed to the called function test_varargs correctly */
}
int main()
{
varargs_assign((numentry_t)test_varargs);
return 0;
}
In function, varargs_assign(), when (((vararg.func)))(1, 100) is called,
2nd arguement for function test_varargs() is not passed as 100.
I also observed that, when (vararg.func))(1, 100) is typecasted to take
2 arguments, the 2nd argument is passed correctly to test_varargs().
Can anyone please suggest what compiler options (CFLAGS), need to be updated,
to get correct value for 2nd argument in function test_varargs without typecasting
Regards,
Anjana
Hello,
Thank you for reaching out to us.
After intensive and careful investigations, we concluded that the issue is related to the compiler itself, the compiler flags have nothing to do with it.
Thank you for bringing this into our attention, we will analyze this issue further and we will announce you when we have a fix available for this bug.
Best Regards,
The GNU Tools Team
Hello GNU Tools Team,
Can I know when the new tool chain will be released with this issue fixed?
Best Regards,
Rajeshwari