https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85138
Thomas Koenig <tkoenig at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tkoenig at gcc dot gnu.org --- Comment #7 from Thomas Koenig <tkoenig at gcc dot gnu.org> --- First, I have renamed the function "len" to "llen" in the original test case to avoid confusion with the intrinsic. The problem seems to be that, at the entry of pure_function(), there are different opinions about purity: (gdb) p e->symtree->n.sym->name $6 = 0x7ffff743b078 "llen" (gdb) p e->symtree->n.sym->attr.pure $7 = 0 (gdb) p e->value.function $8 = {actual = 0x2515700, name = 0x7ffff7438a80 "str_real_sp_fmt_len", isym = 0x0, esym = 0x2581200} (gdb) p e->value.function.esym->attr.pure $9 = 1 (Why this problem is exposed by Steve's patch, I have no idea). Investigating further...