From e4b5b3a5cb422662b1c4ef1102bf559082017ac3 Mon Sep 17 00:00:00 2001
From: Jan Hubicka <hubicka@ucw.cz>
Date: Wed, 13 May 2015 04:57:27 +0200
Subject: [PATCH] re PR ipa/65873 (Failure to inline always_inline memcpy)

	PR ipa/65873
	* ipa-inline.c (can_inline_edge_p): Allow early inlining of always
	inlines across optimization boundary.
	* testsuite/gcc.c-torture/compile/pr65873.c: New testcase.

From-SVN: r223108
---
 gcc/testsuite/ChangeLog                       |  5 +++++
 gcc/testsuite/gcc.c-torture/compile/pr65873.c | 14 ++++++++++++++
 2 files changed, 19 insertions(+)
 create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr65873.c

diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d8b6a582e7be..fedfe4396285 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2015-05-12  Jan Hubicka  <hubicka@ucw.cz>
+
+	PR ipa/65873
+	* gcc.c-torture/compile/pr65873.c: New testcase.
+
 2015-05-12  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
 	PR fortran/66111
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr65873.c b/gcc/testsuite/gcc.c-torture/compile/pr65873.c
new file mode 100644
index 000000000000..854f02c5f081
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr65873.c
@@ -0,0 +1,14 @@
+typedef __SIZE_TYPE__ size_t;
+
+extern inline __attribute__ ((__always_inline__, __gnu_inline__, __artificial__, __nothrow__, __leaf__)) void *
+memcpy (void *__restrict __dest, const void *__restrict __src, size_t __len)
+{
+  return __builtin___memcpy_chk (__dest, __src, __len, __builtin_object_size (__dest, 0));
+}
+
+__attribute__((optimize ("Ofast"))) void
+bar (void *d, void *s, size_t l)
+{
+  memcpy (d, s, l);
+}
+
-- 
GitLab