https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127134
Bug ID: 127134
Summary: [16/17 Regression] lim at -Ofast incorrectly assumes a
store to this (const) will not trap
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 65450
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=65450&action=edit
testcase
This testcase is optimized incorrectly at -Ofast starting in GCC 16 due to
r16-3568-ge8969a86c1052e . LIM assumes a store motion can happen and not be
considered conditional because *this cannot trap but this testcase shows
otherwise.
I thought up this testcase after thinking up the testcase for PR 127133 which
was done after reviewing
https://inbox.sourceware.org/gcc-patches/[email protected]/
and such. Most likely that would have the same issue for a const reference
too.