https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123973
David Malcolm <dmalcolm at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Last reconfirmed| |2026-02-04
Status|UNCONFIRMED |ASSIGNED
--- Comment #2 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Thanks for filing this bug.
Looks like sufficiently_different_region_binding_p gets confused between the
params at different stack depths; it gets (8-x) for y at depths 2 and 3, but
doesn't treat "x" as being different values:
(gdb) call new_sval->dump()
(20): ‘int’: binop_svalue(minus_expr: ‘-’)
├─ (18): ‘int’: constant_svalue (‘8’)
╰─ (14): ‘int’: initial_svalue
╰─ m_reg: (11): ‘int’: decl_region(‘x_4(D)’)
╰─ parent: (9): frame_region(‘fun’, index: 0, depth: 1)
╰─ parent: (1): stack region
╰─ parent: (0): root region
(gdb) call prev_sval->dump()
(20): ‘int’: binop_svalue(minus_expr: ‘-’)
├─ (18): ‘int’: constant_svalue (‘8’)
╰─ (14): ‘int’: initial_svalue
╰─ m_reg: (11): ‘int’: decl_region(‘x_4(D)’)
╰─ parent: (9): frame_region(‘fun’, index: 0, depth: 1)
╰─ parent: (1): stack region
╰─ parent: (0): root region