This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][Middle-end] disable strcmp/strncmp inlining with O2 below and Os


On Wed, 25 Jul 2018 at 19:08, Qing Zhao <qing.zhao@oracle.com> 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?
>
> 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.
> +
>

Hi,

After this change, I've noticed that:
FAIL: gcc.dg/strcmpopt_6.c scan-rtl-dump-times expand "__builtin_memcmp" 6
on arm-none-linux-gnueabi
--with-mode thumb
--with-cpu cortex-a9
and forcing -march=armv5t via RUNTESTFLAGS

The log says:
gcc.dg/strcmpopt_6.c: pattern found 4 times
FAIL: gcc.dg/strcmpopt_6.c scan-rtl-dump-times expand "__builtin_memcmp" 6

Christophe


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]