]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fix wrong array type conversion with different storage orde
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 22 Nov 2022 18:03:49 +0000 (19:03 +0100)
committerEric Botcazou <ebotcazou@adacore.com>
Fri, 25 Nov 2022 09:57:43 +0000 (10:57 +0100)
commit3a34f1f56ad27ac6e1c4765433c06ebd3492b51b
tree47387a147101c97758a4a470fde01060c55194e4
parent37a7b2e8a73a4ce19e25fd067fbe311547e112a1
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