From: Andreas Schwab <schwab@linux-m68k.org>
To: Greg Ungerer <gerg@snapgear.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
Greg Ungerer <gerg@uclinux.org>,
linux-m68k@vger.kernel.org
Subject: Re: [PATCH 0/6] m68k: merge and clean up files in m68k/lib
Date: Thu, 07 Apr 2011 10:22:03 +0200 [thread overview]
Message-ID: <m34o6acvys.fsf@linux-m68k.org> (raw)
In-Reply-To: <4D9D35AF.3000009@snapgear.com> (Greg Ungerer's message of "Thu, 7 Apr 2011 13:55:27 +1000")
Greg Ungerer <gerg@snapgear.com> writes:
> That does seem odd. One way or another strcpy is defined in
> arch/m68k/include/asm/string.h. I would expect no real calls to
> strcpy() after that. (And for me on my hand built gcc-4.5.1 I
> don't end up with any).
Did you compile with -Os?
> At a guess the section for __GNUC__ > 4 must end up still trying
> to use a real strcpy (presumably the __builtom_strcpy call) on
> some versions of gcc.
>
> #if __GNUC__ >= 4
> #define strcpy(d, s) (__builtin_constant_p(s) && \
> __builtin_strlen(s) <= 32 ? \
> __builtin_strcpy(d, s) : \
> __kernel_strcpy(d, s))
> #else
> #define strcpy(d, s) __kernel_strcpy(d, s)
> #endif
>
> Is there any reason we don't just drop the __GNUC__ >= 4 bit
> and always just use __kernel_strcpy()? After all kernel_strcpy
> is a pretty tight optimized loop for m68k anyway.
The compiler can generate libcalls to strcpy any time while optimizing
any other standard C function, and those libcalls won't see the macros,
of course. The only way to stop the compiler from doing that is to
disable all builtin functions (just -fno-builtin-strcpy is not enough),
but that would disable a lot of useful opimisations.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
next prev parent reply other threads:[~2011-04-07 8:22 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-30 7:58 [PATCH 0/6] m68k: merge and clean up files in m68k/lib Greg Ungerer
2011-03-30 7:58 ` [PATCH 1/6] m68k: merge mmu and non-mmu versions of muldi3 Greg Ungerer
2011-03-30 7:58 ` [PATCH 2/6] m68k: merge mmu and non-mmu versions of lib/Makefile Greg Ungerer
2011-03-30 7:58 ` [PATCH 3/6] m68k: remove duplicate memmove() implementation Greg Ungerer
2011-03-30 7:58 ` [PATCH 4/6] m68k: remove duplicate memset() implementation Greg Ungerer
2011-03-30 7:58 ` [PATCH 5/6] m68k: remove duplicate memcpy() implementation Greg Ungerer
2011-03-30 7:58 ` [PATCH 6/6] m68k: remove no longer used arch/m68k/lib/string.c Greg Ungerer
2011-03-30 18:26 ` Geert Uytterhoeven
2011-03-31 3:58 ` Greg Ungerer
2011-03-30 18:11 ` [PATCH 1/6] m68k: merge mmu and non-mmu versions of muldi3 Geert Uytterhoeven
2011-03-31 3:57 ` Greg Ungerer
2011-03-30 18:41 ` [PATCH 0/6] m68k: merge and clean up files in m68k/lib Geert Uytterhoeven
2011-03-31 4:01 ` Greg Ungerer
2011-04-06 19:36 ` Geert Uytterhoeven
2011-04-07 3:55 ` Greg Ungerer
2011-04-07 8:22 ` Andreas Schwab [this message]
2011-04-07 11:26 ` Greg Ungerer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m34o6acvys.fsf@linux-m68k.org \
--to=schwab@linux-m68k.org \
--cc=geert@linux-m68k.org \
--cc=gerg@snapgear.com \
--cc=gerg@uclinux.org \
--cc=linux-m68k@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox