While there might exist a case that can be vectorized, a few of the simple
cases that should be easy that I have tried are not able to be vectorized.
For example, the following
package compare_lang is
type the_range is range 0 .. 100;
type My_Array is array (the_range) of Float;
a, b, c : my_array;
procedure do_compare;
end compare_lang;
package body compare_lang is
procedure do_compare is
begin
for JJJ in the_range loop
a(jjj) := b(jjj) * c(jjj);
end loop;
end do_compare;
end compare_lang;
gcc -c -O3 -gnatp -march=pentium4 -mfpmath=sse -msse3 -ftree-vectorize
-ftree-vectorizer-verbose=5 compare_lang.adb
compare_lang.adb:5: note: not vectorized: complicated access pattern.
compare_lang.adb:3: note: vectorized 0 loops in function.
Obviously similar structures C vectorize fine.
--
Summary: Ada fails to vectorize even trivial loops
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ada
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jeff at thecreems dot com
GCC host triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29533