https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124635

--- Comment #6 from uecker at gcc dot gnu.org ---
Something like this:

diff --git a/gcc/c/c-typeck.cc b/gcc/c/c-typeck.cc
index 4452bb32728..043e49794ca 100644
--- a/gcc/c/c-typeck.cc
+++ b/gcc/c/c-typeck.cc
@@ -548,8 +548,14 @@ c_reconstruct_complex_type (tree type, tree bottom)
}
else if (TREE_CODE (type) == ARRAY_TYPE)
{
+ bool rso = TYPE_REVERSE_STORAGE_ORDER (type);
inner = c_reconstruct_complex_type (TREE_TYPE (type), bottom);
outer = c_build_array_type (inner, TYPE_DOMAIN (type));
+ if (rso)
+ {
+ outer = build_distinct_type_copy (outer);
+ TYPE_REVERSE_STORAGE_ORDER (outer) = 1;
+ }
gcc_checking_assert (C_TYPE_VARIABLE_SIZE (type)
== C_TYPE_VARIABLE_SIZE (outer));

Reply via email to