Mercurial > hg > CbC > CbC_gcc
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gcc/testsuite/g++.dg/tree-ssa/pr86062.C Thu Oct 25 07:37:49 2018 +0900 @@ -0,0 +1,23 @@ +// { dg-do compile } +// { dg-require-effective-target c++14 } +// { dg-options "-O2 -ffinite-math-only -fdump-tree-fre1" } + +#include <array> + +struct I { double i,s; I(double d):i(d),s(d){} }; +typedef std::array<double,3> P; +typedef std::array<I,3> AP; + +static AP c(P const&p){ + return {p[0],p[1],p[2]}; +} +template<class T> auto const& ac(T const&p, int n){return p[n];} +static double g(P const&p, int n) +{ + I res = ac(c(p),n); + return res.s-res.i; +} + +__attribute__((flatten)) double fff(P p){ return g(p,1); } + +// { dg-final { scan-tree-dump "return 0.0;" "fre1" } }