re PR ipa/65873 (Failure to inline always_inline memcpy)
authorJan Hubicka <hubicka@ucw.cz>
Wed, 13 May 2015 02:57:27 +0000 (04:57 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Wed, 13 May 2015 02:57:27 +0000 (02:57 +0000)
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
gcc/testsuite/gcc.c-torture/compile/pr65873.c [new file with mode: 0644]

index d8b6a582e7be23fbfbb7bb8cb9126fc539de43ef..fedfe4396285c0b1ea41f1f00773d2ce0ebdfe53 100644 (file)
@@ -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 (file)
index 0000000..854f02c
--- /dev/null
@@ -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);
+}
+