summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr51683.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2011-12-31 23:53:57 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2011-12-31 23:53:57 +0000
commit3064bb7bdf4b3e57842207a7cfbb72d686ace48a (patch)
treeeae0d52d578dbcd38c56a08992fb9bb1ddb7b2ac /gcc/testsuite/gcc.dg/pr51683.c
parent8081d3a635c46337db187a9f6971e707986bf1a8 (diff)
downloadgcc-3064bb7bdf4b3e57842207a7cfbb72d686ace48a.tar.gz
PR tree-optimization/51683
* tree-ssa-propagate.c (substitute_and_fold): Don't optimize away calls with side-effects. * tree-ssa-ccp.c (ccp_fold_stmt): Likewise. * gcc.dg/pr51683.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182761 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr51683.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr51683.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr51683.c b/gcc/testsuite/gcc.dg/pr51683.c
new file mode 100644
index 00000000000..f5a4a8be485
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr51683.c
@@ -0,0 +1,18 @@
+/* PR tree-optimization/51683 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+static inline void *
+bar (void *p, void *q, int r)
+{
+ return __builtin_memcpy (p, q, r);
+}
+
+void *
+foo (void *p)
+{
+ return bar ((void *) 0x12345000, p, 256);
+}
+
+/* { dg-final { scan-tree-dump "memcpy" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */