This repository has been archived by the owner on Apr 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 56
ambiguous corner cases in calling convention regarding zero-length arrays #48
Comments
I've created #49 to cover these corner cases, based on the behavior of GCC trunk. But again, maybe the status quo of GCC is not perfect. |
Please note that if you'd like to change GCC behavior it's better to do it ASAP. Once GCC 12 is released, you'll need to write some really boring code to emit -Wpsabi warnings for any ABI change. |
GCC patch proposed at https://gcc.gnu.org/pipermail/gcc-patches/2022-April/593397.html. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Consider such cases:
Case 1:
Case 2:
Case 3:
Current calling convention doc is not clear on "if
f::x
is considered a member", "iff::x
is considered a floating-point member", and "iff::x
is considered onefloat
(ordouble
) member". Note that we are saying:But it does not cover "empty" arrays.
And current GCC trunk is doing strange things (IMO). For Case 2, it passes
b
in FAR. But for Case 3, it passesb
in GAR.In my opinion the most "clear" solution is to ignore the empty arrays (and bitfields: https://gcc.gnu.org/PR102024) altogether with empty aggreates. But that will requires to update GCC behavior, fortunately we still have an oppertunity to do this before GCC 12 release (if we move fast). CC GCC maintainers: @ChenghuaXu @chenglulu
Another solution is to document the current GCC behavior clearly in the doc.
But I don't know to write it(as I consider the current behavior "strange").The text was updated successfully, but these errors were encountered: