aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2010-11-10 21:23:09 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2010-11-10 20:23:09 +0000
commitc5d0600d09df75581455e2152500866aa5d49f2e (patch)
treed022ce30fea75864afaa32f9c9554dbd2b710d9c /gcc/testsuite
parentd707fc773877a218f563042d5c26657c5d1bd736 (diff)
downloadgcc-c5d0600d09df75581455e2152500866aa5d49f2e.zip
gcc-c5d0600d09df75581455e2152500866aa5d49f2e.tar.gz
gcc-c5d0600d09df75581455e2152500866aa5d49f2e.tar.bz2
re PR tree-optimization/46228 (code produced for STL container is worse in 4.5.1 than in 4.4.5)
PR tree-optimize/46228 * doc/invoke.texi (comdat-sharing-probability): Document. * ipa-inline.c (cgraph_estimate_growth): Handle COMDATs * params.def (PARAM_COMDAT_SHARING_PROBABILITY): New param. * g++.dg/tree-ssa/pr46228.C: New testcase. From-SVN: r166555
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/pr46228.C23
2 files changed, 28 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index b00c673..661e55b 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2010-11-10 Jan Hubicka <jh@suse.cz>
+
+ PR tree-optimize/46228
+ * g++.dg/tree-ssa/pr46228.C: New testcase.
+
2010-11-10 H.J. Lu <hongjiu.lu@intel.com>
PR tree-optimization/46414
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr46228.C b/gcc/testsuite/g++.dg/tree-ssa/pr46228.C
new file mode 100644
index 0000000..a720dbe
--- /dev/null
+++ b/gcc/testsuite/g++.dg/tree-ssa/pr46228.C
@@ -0,0 +1,23 @@
+// { dg-options "-fdump-tree-optimized -Os" }
+#include <set>
+#include <stdio.h>
+
+int main()
+{
+ static const int array[] = { 1,2,3,4,5,6,7,8,9,10,6 };
+ std::set<int> the_set;
+ int count = 0;
+ for (unsigned i = 0; i < sizeof(array)/sizeof(*array); i++)
+ {
+ std::pair<std::set<int>::iterator, bool> result =
+ the_set.insert(array[i]);
+ if (result.second)
+ count++;
+ }
+ printf("%d unique items in array.\n", count);
+ return 0;
+}
+
+// This function is small enough to be inlined even at -Os.
+// { dg-final { scan-tree-dump-not "_ZNSt8_Rb_treeIiiSt9_IdentityIiESt4lessIiESaIiEED2Ev" "optimized" } }
+// { dg-final { cleanup-tree-dump "optimized" } }