public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ipa/65873] New: [5/6 Regression] Failure to inline always_inline memcpy
@ 2015-04-24  9:55 jakub at gcc dot gnu.org
  2015-04-24  9:55 ` [Bug ipa/65873] " jakub at gcc dot gnu.org
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-04-24  9:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65873

            Bug ID: 65873
           Summary: [5/6 Regression] Failure to inline always_inline
                    memcpy
           Product: gcc
           Version: 5.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org

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);
}

fails to compile starting with r221706 (or r221707, neither of those versions
compile, r221704 works, r221710 fails).

This makes with -D_FORTIFY_SOURCE=2 all fortified functions unusable in
functions with explicit (non-default) optimize attribute.

As the always_inline function doesn't have a specific optimize attribute, I'd
say at least for always_inline functions it is undesirable to refuse to inline
them.  For target attribute, do we also refuse to inline, if say the whole CU
is compiled with -mavx2 and some function uses __attribute__((target ("sse2")))
and calls memcpy?


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2022-01-09  0:44 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-24  9:55 [Bug ipa/65873] New: [5/6 Regression] Failure to inline always_inline memcpy jakub at gcc dot gnu.org
2015-04-24  9:55 ` [Bug ipa/65873] " jakub at gcc dot gnu.org
2015-04-24  9:56 ` jakub at gcc dot gnu.org
2015-04-27  8:05 ` hubicka at gcc dot gnu.org
2015-04-27  8:14 ` jakub at gcc dot gnu.org
2015-04-27  9:19 ` rguenth at gcc dot gnu.org
2015-04-30 15:09 ` hubicka at gcc dot gnu.org
2015-05-05  7:41 ` jakub at gcc dot gnu.org
2015-05-13  0:09 ` hubicka at gcc dot gnu.org
2015-05-13  2:55 ` hubicka at gcc dot gnu.org
2015-05-13  2:58 ` hubicka at gcc dot gnu.org
2015-05-13 15:51 ` [Bug ipa/65873] [5 " hubicka at gcc dot gnu.org
2015-05-17 17:43 ` hubicka at gcc dot gnu.org
2015-05-23 19:38 ` [Bug ipa/65873] " hubicka at gcc dot gnu.org
2015-07-16  9:17 ` rguenth at gcc dot gnu.org
2022-01-09  0:44 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).