Landing: 95ee9c9e74eb

Project / Subsystem

gcc / cfgexpand

Date

2026-07-26

Author

Kyrylo Tkachov

Commit

95ee9c9e74eb93414bbcd76b02e1fcbec383f2ce

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
cfgexpand
patch_id
commit_hash
95ee9c9e74eb93414bbcd76b02e1fcbec383f2ce
source_type
github
headline
cfgexpand: Verify partitions do not share MEM_EXPR
tldr
cfgexpand now verifies that partitions do not share a MEM_EXPR to prevent miscompilations.
author
Kyrylo Tkachov
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • optimization
  • middle-end
  • verification
  • memory-aliasing
discussion_id_link
bugzilla_pr
date
2026-07-26T00:00:00.000Z

A new verification function, verify_partition_mem_exprs, has been added to cfgexpand.cc. It checks that distinct stack slots carrying a MEM_EXPR are not incorrectly identified as a single object by the load/store pair-fusion pass. This prevents miscompilations that occurred when accesses to different memory locations were fused due to shared MEM_EXPR bases and offsets. The check is performed per function when flag_checking is enabled.