PR tree-optimization/86415 - strlen() not folded for substrings within constant arrays
[official-gcc.git] / gcc / testsuite / g++.dg / vect / pr50698.cc
blobfad5969f7060059784e8c015b5eff0f844765617
1 // { dg-do compile }
2 // { dg-require-effective-target vect_float }
4 float mem[4096];
5 const int N=1024;
7 struct XYZ {
8 float * mem;
9 int n;
10 float * x() { return mem;}
11 float * y() { return x()+n;}
12 float * z() { return y()+n;}
15 inline
16 void sum(float * x, float * y, float * z, int n) {
17 for (int i=0;i!=n; ++i)
18 x[i]=y[i]+z[i];
21 void sumS() {
22 XYZ xyz; xyz.mem=mem; xyz.n=N;
23 sum(xyz.x(),xyz.y(),xyz.z(),xyz.n);
26 // { dg-final { scan-tree-dump-not "run-time aliasing" "vect" } }