Landing: b1215a5b1e69

Project / Subsystem

gcc / gcc

Date

2026-09-10

Author

Richard Sandiford

Commit

b1215a5b1e6948733f46ecb4d3918083a1d298f8

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
gcc
patch_id
—
commit_hash
b1215a5b1e6948733f46ecb4d3918083a1d298f8
source_type
github
headline
GCC: Optimize recog_data state management
tldr
Reduces overhead of managing compiler state by using macros and pointer swapping instead of copying large data structures.
author
Richard Sandiford
outcome
committed
performance_win
true
breaking_change
false
series_id
—
series_parts
[]
tags
  • • optimization
  • • internal
  • • compiler internals
discussion_id_link
—
bugzilla_pr
—
date
2026-09-10T00:00:00.000Z

This commit refactors the management of recog_data, a global variable used by the instruction extraction process. Instead of copying the large recog_data_d structure, it is now accessed via a macro that dereferences a pointer. This allows saving and restoring its state by simply swapping pointers, significantly reducing overhead. The change also converts several backends (reload, i386, sh) to use a new RAII class recog_state_saver for managing this state, improving efficiency and code robustness.