Skip to content
Snippets Groups Projects
Commit 4a1cd556 authored by Richard Biener's avatar Richard Biener
Browse files

tree-optimization/113896 - testcase for fixed PR

The SLP permute optimization rewrite fixed this.

	PR tree-optimization/113896
	* g++.dg/torture/pr113896.C: New testcase.
parent 94225dfb
No related branches found
No related tags found
No related merge requests found
// { dg-do run }
// { dg-additional-options "-ffast-math" }
double a1 = 1.0;
double a2 = 1.0;
void __attribute__((noipa))
f(double K[2], bool b)
{
double A[] = {
b ? a1 : a2,
0,
0,
0
};
double sum{};
for(double a : A) sum += a;
for(double& a : A) a /= sum;
if (b) {
K[0] = A[0]; // 1.0
K[1] = A[1]; // 0.0
} else {
K[0] = A[0] + A[1];
}
}
int main()
{
double K[2]{};
f(K, true);
if (K[0] != 1. || K[1] != 0.)
__builtin_abort ();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment