https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127133
Bug ID: 127133
Summary: [17 Regression] cond_store_replacement_limited
mishandles const this
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: pinskia at gcc dot gnu.org
Target Milestone: ---
Created attachment 65449
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=65449&action=edit
testcase
cond_store_replacement_limited incorrect thinks that since *this does not trap
for read; it won't trap for writes either.
See the testcase which shows this is not true.
There is no undefined behavior in the original code because there is no store
that happens to the const case.