view gcc/testsuite/g++.dg/vect/pr61171.cc @ 144:8f4e72ab4e11

fix segmentation fault caused by nothing next cur_op to end
author Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Sun, 23 Dec 2018 21:23:56 +0900
parents 04ced10e8804
children
line wrap: on
line source

// { dg-do compile }
// { dg-require-effective-target vect_float }
// { dg-additional-options "-ffast-math" }

float px[1024];
float xx, vv;
unsigned int N=1024;

void ok() {
    for (unsigned j=0U; j<N; ++j) {
	float ax = px[j]-xx;
	vv-=ax;
    }
}

void noOk() {
    for (unsigned j=0U; j<N; ++j) {
	float ax = xx-px[j];
	vv+=ax;
    }
}

// { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" } }