From: Richard Guenther Date: Mon, 23 May 2011 14:36:28 +0000 (+0000) Subject: re PR tree-optimization/40874 (Function object abstraction penalty with inline functi... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e6d944b22615da54b20b4f53a9dad5cad4e0eeb4;p=gcc.git re PR tree-optimization/40874 (Function object abstraction penalty with inline functions.) 2011-05-23 Richard Guenther PR tree-optimization/40874 * g++.dg/tree-ssa/pr40874.C: New testcase. From-SVN: r174068 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e647cb57145..0fd397ce8ba 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-05-23 Richard Guenther + + PR tree-optimization/40874 + * g++.dg/tree-ssa/pr40874.C: New testcase. + 2011-05-23 Richard Guenther PR tree-optimization/49115 diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr40874.C b/gcc/testsuite/g++.dg/tree-ssa/pr40874.C new file mode 100644 index 00000000000..d227ff9aaa3 --- /dev/null +++ b/gcc/testsuite/g++.dg/tree-ssa/pr40874.C @@ -0,0 +1,25 @@ +// { dg-do compile } +// { dg-options "-O -fdump-tree-optimized" } + +struct pf +{ + inline pf(int(*x)(int)) : x(x) {} + + inline int operator()(int a) const + { + return x(a); + } + + int (*x)(int); +}; + +inline int g(int x) { return x/x - 1; } + +int main(int argc, char* argv[]) +{ + pf f(g); + return f(3); +} + +// { dg-final { scan-tree-dump "return 0" "optimized" } } +// { dg-final { cleanup-tree-dump "optimized" } }