Fix wrong array type conversion with different storage orde
commit55cb8c5c9abfe83c342a7b8e8b7dd4bee1791302
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 22 Nov 2022 18:03:49 +0000 (22 19:03 +0100)
committerEric Botcazou <ebotcazou@adacore.com>
Tue, 22 Nov 2022 18:04:58 +0000 (22 19:04 +0100)
tree643d1a2b25dd6ece3f251992e73e9f90be3af7bf
parentdfc1ea414e0cebccfcffc771ebcefa3d24c9754c
Fix wrong array type conversion with different storage orde

When two arrays of scalars have a different storage order in Ada, the
front-end makes sure that the conversion is performed component-wise
so that each component can be reversed.  So it's a little bit counter
productive that the ldist pass performs the opposite transformation
and synthesizes a memcpy/memmove in this case.

gcc/
* tree-loop-distribution.cc (loop_distribution::classify_builtin_ldst):
Bail out if source and destination do not have the same storage order.

gcc/testsuite/
* gnat.dg/sso18.adb: New test.
gcc/testsuite/gnat.dg/sso18.adb [new file with mode: 0644]
gcc/tree-loop-distribution.cc