Landing: 5dc4ab23e0d0

Project / Subsystem

gcc / expand_mult

Date

2026-09-20

Author

Stefan Schulze Frielinghaus

Commit

5dc4ab23e0d01a1fd20c1365bdb2de039d831ff9

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
expand_mult
patch_id
—
commit_hash
5dc4ab23e0d01a1fd20c1365bdb2de039d831ff9
source_type
github
headline
expand_mult: Look through vector mode for constant multipliers
tldr
GCC's `expand_mult` now correctly determines shift amounts for vector constants by examining the scalar operand's mode.
author
Stefan Schulze Frielinghaus
outcome
committed
performance_win
true
breaking_change
false
series_id
—
series_parts
[]
tags
  • • gcc
  • • optimization
  • • vectorization
discussion_id_link
—
bugzilla_pr
—
date
2026-09-20T00:00:00.000Z

GCC’s expand_mult function has been improved to correctly handle constant vector multipliers. When the scalar operand is a CONST_WIDE_INT, the function now looks through the vector mode to determine the scalar mode for calculating the shift amount. This ensures accurate code generation for vector operations, as highlighted by a new test case for a bug that previously miscalculated shift amounts.