summaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2010-10-22 19:03:39 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2010-10-22 19:03:39 +0000
commit07db7d35a9b27002021a96fc0ac4175d102d56d3 (patch)
treeaba9c0452722f367214fd539f57871adfd8cbd2c /gcc/testsuite/c-c++-common
parentd8c801fdbe83d2529221e7beb0e75eebca3e86f9 (diff)
downloadgcc-07db7d35a9b27002021a96fc0ac4175d102d56d3.tar.gz
re PR tree-optimization/46137 (g++.dg/torture/pr45877.C FAILs with -fno-tree-dce)
2010-10-22 Richard Guenther <rguenther@suse.de> PR middle-end/46137 * gimple-fold.c (gimplify_and_update_call_from_tree): Properly remove the virtual operands if they are not needed. * c-c++-common/torture/pr46137.c: New testcase. From-SVN: r165852
Diffstat (limited to 'gcc/testsuite/c-c++-common')
-rw-r--r--gcc/testsuite/c-c++-common/torture/pr46137.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/c-c++-common/torture/pr46137.c b/gcc/testsuite/c-c++-common/torture/pr46137.c
new file mode 100644
index 00000000000..3e44ff6b7c9
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/torture/pr46137.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+
+struct X { };
+
+static inline void *
+bar (void *dst, void *src)
+{
+ return __builtin___memcpy_chk (dst, src, sizeof (struct X),
+ __builtin_object_size (dst, 0));
+}
+
+struct X
+foo (struct X *x)
+{
+ struct X any;
+ bar (&any, x);
+ return any;
+}