Landing: 0646376b3e34

Project / Subsystem

gcc / libstdc++

Date

2026-05-06

Author

Tomasz Kamiński

Commit

0646376b3e340ef1a0a55d143e38410f75f81276

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
libstdc++
patch_id
commit_hash
0646376b3e340ef1a0a55d143e38410f75f81276
source_type
github
headline
libstdc++: Reduce instantiations in `__formatter_str::_M_format_range`.
tldr
This commit reorders compile-time checks in `__formatter_str::_M_format_range` to reduce unnecessary template instantiations, potentially improving compile tim…
author
Tomasz Kamiński
outcome
committed
performance_win
true
breaking_change
false
series_id
series_parts
[]
tags
  • libstdc++
  • format
  • optimization
  • templates
discussion_id_link
bugzilla_pr
date
2026-05-06T00:00:00.000Z

The __formatter_str::_M_format_range function in libstdc++ had a series of if constexpr checks that could lead to unnecessary template instantiations. By reordering these checks, the compiler can now directly call the appropriate format overload for prvalues of span or __simply_formattable_range types, reducing the number of instantiations and symbols generated. This can lead to faster compilation times and smaller binaries.