OSDN Git Service

PR tree-optimization/14703
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 6 Sep 2008 17:10:00 +0000 (17:10 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 6 Sep 2008 17:10:00 +0000 (17:10 +0000)
* tree-ssa-live.c (remove_unused_scope_block_p): Remove ignored declarations.
* passes.c (init_optimization_passes): Recompute inline parameters.
* g++.dg/tree-ssa-pr14703.C: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@140068 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/passes.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/tree-ssa/pr14703.C [new file with mode: 0644]
gcc/tree-ssa-live.c

index f3a30d9..ead7b5a 100644 (file)
@@ -1,3 +1,9 @@
+2008-09-06  Jan Hubicka  <jh@suse.cz>
+
+       PR tree-optimization/14703
+       * tree-ssa-live.c (remove_unused_scope_block_p): Remove ignored declarations.
+       * passes.c (init_optimization_passes): Recompute inline parameters.
+
 2008-09-06  Richard Sandiford  <rdsandiford@googlemail.com>
 
        * config/mips/mips.c (mips_function_ok_for_sibcall): Check for
index 36c107e..69d484b 100644 (file)
@@ -565,6 +565,7 @@ init_optimization_passes (void)
        }
       NEXT_PASS (pass_release_ssa_names);
       NEXT_PASS (pass_rebuild_cgraph_edges);
+      NEXT_PASS (pass_inline_parameters);
     }
   NEXT_PASS (pass_ipa_increase_alignment);
   NEXT_PASS (pass_ipa_matrix_reorg);
index aaeb46c..3185f30 100644 (file)
@@ -1,3 +1,7 @@
+2008-09-06  Jan Hubicka  <jh@suse.cz>
+
+       * g++.dg/tree-ssa-pr14703.C: New testcase.
+
 2008-09-06  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/36153
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr14703.C b/gcc/testsuite/g++.dg/tree-ssa/pr14703.C
new file mode 100644 (file)
index 0000000..5870527
--- /dev/null
@@ -0,0 +1,49 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized -fno-ipa-reference" } */
+#include <iostream>
+
+namespace {
+template <unsigned long long L> class fib {
+ public:
+   static const unsigned long long value = fib<L - 1>::value + fib<L - 2>::value;
+};
+
+template <> class fib<0> {
+ public:
+   static const unsigned long long value = 1;
+};
+
+template <> class fib<1> {
+ public:
+   static const unsigned long long value = 1;
+};
+
+template<unsigned long long L> inline unsigned long long fibconst()
+{
+   return fibconst<L - 1>() + fibconst<L - 2>();
+}
+
+template <> inline unsigned long long fibconst<0>()
+{
+   return 1ull;
+}
+
+template <> inline unsigned long long fibconst<1>()
+{
+   return 1ull;
+}
+
+template <> inline unsigned long long fibconst<2>()
+{
+   return 2ull;
+}
+
+}
+
+int main()
+{
+   ::std::cerr << "fib<90>::value == " << fib<90>::value << "\n";
+   ::std::cerr << "fibcst<90>() == " << fibconst<90>() << "\n";
+}
+// { dg-final { scan-tree-dump-not "fibconst" "optimized" } }
+// { dg-final { cleanup-tree-dump "optimized" } }
index fa3834d..859c0c7 100644 (file)
@@ -489,6 +489,13 @@ remove_unused_scope_block_p (tree scope)
       if (TREE_CODE (*t) == FUNCTION_DECL)
        unused = false;
 
+      /* Remove everything we don't generate debug info for.  */
+      else if (DECL_IGNORED_P (*t))
+       {
+         *t = TREE_CHAIN (*t);
+         next = t;
+       }
+
       /* When we are outputting debug info, we usually want to output
         info about optimized-out variables in the scope blocks.
         Exception are the scope blocks not containing any instructions