-
Notifications
You must be signed in to change notification settings - Fork 113
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
The following code run through rv32emu did not function as expected. I have also tested it with spike, confirming that the issue is specific to rv32emu. This error will lead to an error when running #28 embench-iot minver
- global static float array initialization
#include <stdio.h>
static float test[3] = {-3.0, 0.0, 2.0};
int main()
{
printf("%f\n", test[0]);
return 0;
}
compile
riscv32-unknown-elf-gcc test.c -march=rv32imafc -mabi=ilp32 -o test.elf
expect output
-3.000000
inferior exit code 0
actual output
0.000000
inferior exit code 0
Furthermore, I have observed that the same issue exists in the following code.
- global float array initialization
#include <stdio.h>
float test[3] = {-3.0, 0.0, 2.0};
int main()
{
printf("%f\n", test[0]);
return 0;
}
- local static float array initialization
#include <stdio.h>
int main()
{
static float test[3] = {-3.0, 0.0, 2.0};
printf("%f\n", test[0]);
return 0;
}
I notice that it only occurred with the global float array initialization
and static float array initialization
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working