Landing: a0cbca7aefb9

Project / Subsystem

gcc / middle-end

Date

2026-09-14

Author

Kyrylo Tkachov

Commit

a0cbca7aefb94b0241e706fe737e0326eead413d

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
middle-end
patch_id
—
commit_hash
a0cbca7aefb94b0241e706fe737e0326eead413d
source_type
github
headline
Preserve load MEM_NOTRAP for strub watermarks
tldr
Preserves non-trapping memory access information for strub watermark loads, improving optimization safety.
author
Kyrylo Tkachov
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • optimization
  • • middle-end
discussion_id_link
—
bugzilla_pr
—
date
2026-09-14T00:00:00.000Z

This commit improves the handling of memory accesses within the strub built-in function. Previously, the EXPAND_MEMORY construct used for watermark updates would lose the MEM_NOTRAP flag, which indicates a non-trapping load. By creating a shallow copy for the load and deriving its MEM_NOTRAP flag separately, the compiler now correctly preserves this information. This ensures that subsequent conditional stores are not mistakenly marked as non-trapping, maintaining optimization correctness.