Landing: 6e2a2d445b15

Project / Subsystem

gcc / gcc/x86

Date

2026-05-01

Author

H.J. Lu

Commit

6e2a2d445b15de103c966863183a326600475b20

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
gcc/x86
patch_id
commit_hash
6e2a2d445b15de103c966863183a326600475b20
source_type
github
headline
Corrected condition for last_4x_vec_label in ix86_expand_movmem
tldr
Fixes a condition that prevented the generation of a label for certain memory move sizes, affecting inlined memmove performance.
author
H.J. Lu
outcome
committed
performance_win
true
breaking_change
false
series_id
series_parts
[]
tags
  • x86
  • optimization
  • memmove
  • code generation
discussion_id_link
bugzilla_pr
date
2026-05-01T00:00:00.000Z

The condition for generating last_4x_vec_label in ix86_expand_movmem was incorrect, leading to missed optimization opportunities when inlining memmove for specific sizes. The condition min_size < 4 * move_max was changed to min_size <= 4 * move_max to ensure the label is generated when min_size equals 4 * move_max. This can improve performance of inlined memmove in some cases. Several test cases were updated or added to validate the fix.