On Mon, May 18, 2026 at 8:08 AM H.J. Lu <[email protected]> wrote: > > On Mon, May 18, 2026 at 1:56 PM Richard Biener > <[email protected]> wrote: > > > > On Mon, May 18, 2026 at 4:25 AM Liu, Hongtao <[email protected]> wrote: > > > > > > > > > > > > > -----Original Message----- > > > > From: H.J. Lu <[email protected]> > > > > Sent: Monday, May 18, 2026 5:52 AM > > > > To: GCC Patches <[email protected]>; Uros Bizjak > > > > <[email protected]>; Liu, Hongtao <[email protected]> > > > > Subject: [PATCH] x86: Don't inline memmove for -Os > > > > > > > > OK for master and backport to GCC 16? > > > Ok. > > > > > > > > Thanks. > > > > > > > > -- > > > > H.J. > > > > --- > > > > Update ix86_expand_movmem to return false if > > > > optimize_function_for_size_p > > > > returns true to avoid inlining memmove for -Os. > > > > I think you should use optimize_insn_for_size_p instead. > > Do you have a testcase to show that it makes a difference?
It will make a difference with PGO, cold code should be optimized for size. Another testcase would be -O2 with a path ending in abort(), so prediction makes it cold. > > > > > > > > gcc/ > > > > > > > > PR target/125355 > > > > * config/i386/i386-expand.cc (ix86_expand_movmem): Return false for -Os. > > > > > > > > gcc/testsuite/ > > > > > > > > PR target/125355 > > > > * gcc.target/i386/pr125355.c: New test. > > > > -- > H.J.
