Landing: 2fa2088a13bb

Project / Subsystem

gcc / i386

Date

2026-05-29

Author

LIU Hao

Commit

2fa2088a13bbfb37b900a623507bf2b4c15c1f1b

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
i386
patch_id
commit_hash
2fa2088a13bbfb37b900a623507bf2b4c15c1f1b
source_type
github
headline
I386: Rewrite index*1+disp into base+disp
tldr
GCC now optimizes i386 address calculations by rewriting index*1+displacement into base+displacement, reducing code size and improving efficiency.
author
LIU Hao
outcome
committed
performance_win
true
breaking_change
false
series_id
series_parts
[]
tags
  • i386
  • code generation
  • optimization
discussion_id_link
bugzilla_pr
date
2026-05-29T00:00:00.000Z

This commit optimizes address calculations on i386 architectures. It rewrites expressions of the form [index * 1 + displacement] into [base + displacement]. This eliminates the need for a SIB (Scale, Index, Base) byte in the instruction encoding, as RSP cannot be used as index. This rewrite also allows small displacements to be encoded in a single byte, further reducing code size.