view gcc/testsuite/g++.dg/tree-ssa/pr86062.C @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 84e7813d76e9
children
line wrap: on
line source

// { 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" } }