The hard FP calling convention currently states "Fields containing empty structs or unions are ignored while flattening, even in C++, unless they have nontrivial copy constructors or destructors." It appears that g++ doesn't ignore an array of empty records in a struct. If this is indeed the desired behaviour, it would be good to document it.
$ cat t.c
struct empty { struct { struct { } e; }; };
struct s { struct empty e[1]; float f; };
float test_s(struct s a) {
return a.f+1.0;
}
In the above example, the float is passed in a0 with g++ but fa0 with gcc.
The hard FP calling convention currently states "Fields containing empty structs or unions are ignored while flattening, even in C++, unless they have nontrivial copy constructors or destructors." It appears that g++ doesn't ignore an array of empty records in a struct. If this is indeed the desired behaviour, it would be good to document it.
In the above example, the float is passed in a0 with g++ but fa0 with gcc.