You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is about static initializers for struct fields. I have a struct that contains an array. I have a global instance of the struct and I am attempting to initialize an array that is a member of that struct. The minimal example below illustrates the problem.
>$cat staticinit.c
typedef struct t_t{
int a[1];
} t;
t o1 = {.a = {1}};
int f(){
return o1.a[0];
}
When I build with cgeist, I see the following output:
memref.global @o1 : memref<1x!llvm.struct<(array<1 x i32>)>> = uninitialized
The behavior that I would expect here is that the global would be initialized. It seems like that warning should be a fail-stop condition. As it is, programs that produce that warning during compilation are miscompiled, with their globals left uninitialized.
The text was updated successfully, but these errors were encountered:
This issue is about static initializers for struct fields. I have a struct that contains an array. I have a global instance of the struct and I am attempting to initialize an array that is a member of that struct. The minimal example below illustrates the problem.
When I build with
cgeist
, I see the following output:And inspecting the resultant MLIR, I see that, indeed, my global o1 is being left uninitialized.
The important line in that output is this one:
The behavior that I would expect here is that the global would be initialized. It seems like that warning should be a fail-stop condition. As it is, programs that produce that warning during compilation are miscompiled, with their globals left uninitialized.
The text was updated successfully, but these errors were encountered: