Landing: bc01d2d75928

Project / Subsystem

gcc / c++

Date

2026-04-29

Author

Jakub Jelinek

Commit

bc01d2d759285a992076544457ad284bb48632ef

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
c++
patch_id
commit_hash
bc01d2d759285a992076544457ad284bb48632ef
source_type
github
headline
c++: Fix up REFLECT_BASE comparison
tldr
This commit fixes an ICE (Internal Compiler Error) in `cp_tree_equal` when comparing `REFLECT_BASE` nodes in C++ reflection.
author
Jakub Jelinek
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • c++
  • reflection
  • bugfix
  • ICE
discussion_id_link
bugzilla_pr
date
2026-04-29T00:00:00.000Z

This commit resolves an ICE in cp_tree_equal when comparing REFLECT_BASE nodes, which arose from a recent change in reflection handling. When comparing REFLECT_BASE nodes with different TREE_CODE values the compiler would previously crash. This commit fixes this issue by directly comparing the pointers of the REFLECT_BASE nodes, preventing the erroneous call to cp_tree_equal with unexpected input and thus the ICE. A new test case is added to prevent regressions.