comparison gcc/testsuite/g++.dg/tree-ssa/pr86062.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents
children
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
1 // { dg-do compile }
2 // { dg-require-effective-target c++14 }
3 // { dg-options "-O2 -ffinite-math-only -fdump-tree-fre1" }
4
5 #include <array>
6
7 struct I { double i,s; I(double d):i(d),s(d){} };
8 typedef std::array<double,3> P;
9 typedef std::array<I,3> AP;
10
11 static AP c(P const&p){
12 return {p[0],p[1],p[2]};
13 }
14 template<class T> auto const& ac(T const&p, int n){return p[n];}
15 static double g(P const&p, int n)
16 {
17 I res = ac(c(p),n);
18 return res.s-res.i;
19 }
20
21 __attribute__((flatten)) double fff(P p){ return g(p,1); }
22
23 // { dg-final { scan-tree-dump "return 0.0;" "fre1" } }