https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109527
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target|X86_64 |x86_64-*-*
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
We get here from
movw $1, (%rdi)
movl $1, %eax
via a peephole2:
+Splitting with gen_peephole2_162 (i386.md:23103)
...
- 6: [di:DI]=0x1
- REG_DEAD di:DI
+ 22: ax:HI=0x1
+ 23: [di:DI]=ax:HI
11: ax:HI=0x1
12: use ax:HI
there's no later CSE that would optimize this (maybe the peephole2 pass
could fire CSE on each [E]BB a peephole2 triggers?).
The reason for this transform is LCP stalls on Core2/CoreiX which is
also done when tuning for generic. -mtune-ctrl=^lcp_stall retains
the immediate move.