https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122610
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Component|middle-end |ipa
Last reconfirmed| |2025-11-26
Ever confirmed|0 |1
--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
char *RSTRING_PTR(VALUE str) { return rbimpl_rstring_getmem(str).as.heap.ptr; }
is mis-analyzed:
modref analyzing 'RSTRING_PTR/4' (ipa=1) (pure)
Analyzing flags of ssa name: str_2(D)
Analyzing stmt: D.3007 = rbimpl_rstring_getmem (str_2(D)); [return slot
optimization]
current flags of str_2(D)
flags of ssa name str_2(D)
BB 2 preorder 2 posorder 3 low 2 high 3
Always executed bbbs (assuming return or EH): 2
- Analyzing store: D.3007
- Read-only or local, ignoring.
- Analyzing load: D.3007.as.heap.ptr
- Read-only or local, ignoring.
- modref done with result: tracked.
loads:
stores:
Try dse
...
Start of SCC component
Processing RSTRING_PTR/4 (pure)
Propagation finished in 1 iterations
Function found to be const: RSTRING_PTR/4
Declaration updated to be const: RSTRING_PTR/4
Processing RSTRING_PTR/4 (const)
Propagation of flags finished in 1 iterations
Propagated modref for RSTRING_PTR/4 (const)
loads:
stores:
Try dse
when I hide rbimpl_rstring_getmem we instead see
Start of SCC component
Processing RSTRING_PTR/3
Call to rbimpl_rstring_getmem/6
Call target interposable or not available
collapsing loads
collapsing stores
Processing RSTRING_PTR/3
Propagation finished in 2 iterations
Processing RSTRING_PTR/3
Propagation of flags finished in 1 iterations
Propagated modref for RSTRING_PTR/3
loads:
Every base
stores:
Every base