This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][Middle-end] disable strcmp/strncmp inlining with O2 below and Os
- From: Richard Biener <rguenther at suse dot de>
- To: Qing Zhao <qing dot zhao at oracle dot com>
- Cc: gcc Patches <gcc-patches at gcc dot gnu dot org>, jakub Jelinek <jakub at redhat dot com>, jeff Law <law at redhat dot com>, Wilco Dijkstra <wilco dot dijkstra at arm dot com>
- Date: Thu, 26 Jul 2018 10:26:45 +0200 (CEST)
- Subject: Re: [PATCH][Middle-end] disable strcmp/strncmp inlining with O2 below and Os
- References: <F88F031B-EE1A-4BA8-9CD9-E0A224CE85B2@oracle.com>
On Wed, 25 Jul 2018, Qing Zhao wrote:
> Hi,
>
> As Wilco suggested, the new added strcmp/strncmp inlining should be only enabled with O2 and above.
>
> this is the simple patch for this change.
>
> tested on both X86 and aarch64.
>
> Okay for thunk?
You should simply use
if (optimize_insn_for_size_p ())
return NULL_RTX;
to be properly profile-aware. OK with that change.
Richard.
> Qing
>
> gcc/ChangeLog:
>
> +2018-07-25 Qing Zhao <qing.zhao@oracle.com>
> +
> + * builtins.c (inline_expand_builtin_string_cmp): Disable inlining
> + when optimization level is lower than 2 or optimize for size.
> +
>
> gcc/testsuite/ChangeLog:
>
> +2018-07-25 Qing Zhao <qing.zhao@oracle.com>
> +
> + * gcc.dg/strcmpopt_5.c: Change to O2 to enable the transformation.
> + * gcc.dg/strcmpopt_6.c: Likewise.
> +
>
>
--
Richard Biener <rguenther@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg)