This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/81907] memset called when it does not need to be; -mtune=cortex-a9
- From: "rearnsha at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 22 Aug 2017 10:11:34 +0000
- Subject: [Bug target/81907] memset called when it does not need to be; -mtune=cortex-a9
- Auto-submitted: auto-generated
- References: <bug-81907-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81907
--- Comment #14 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
(In reply to dongkyun.s from comment #13)
> > Confirmed the call on 6.4.1 but GCC 7 and trunk don't generate the call for -mcpu=cortex-a9 .
>
> I also verified memset call is not generated with GCC 7.1 + "-mcpu=cortex-a9
> or -mtune=cortex-a9" or lower.
>
> It seems interesting that
> in GCC6,
> - don't generate the memset call for -mcpu=cortex-a12 or higer(e.g,
> cortex-a15, V7 big.LITTLE)
> - always generate the memset call for -mcpu=cortex-a9 or lower(e.g,
> cortex-a7, cotex-a5)
>
> in GCC7.1
> - always don't generate the memset call (even with V3 Architecture
> Processors. e.g, -mcpu=arm7)
There's nothing in the compiler that explicitly says: use memset for these
cores and not for others. The choice will be down to available instructions
and their relative costs.