https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84340
--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> --- Created attachment 43401 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43401&action=edit Untested patch Problem here is that we can't have 'W' ('R' respectively) as the arguments are read addresses and the internal functions write/read to shadow memory. Thus can't have EAF_DIRECT flag set: /* Call argument flags. */ /* Nonzero if the argument is not dereferenced recursively, thus only directly reachable memory is read or written. */ #define EAF_DIRECT (1 << 0) int gimple_call_arg_flags (const gcall *stmt, unsigned arg) { const_tree attr = gimple_call_fnspec (stmt); if (!attr || 1 + arg >= (unsigned) TREE_STRING_LENGTH (attr)) return 0; switch (TREE_STRING_POINTER (attr)[1 + arg]) { case 'x': case 'X': return EAF_UNUSED; case 'R': return EAF_DIRECT | EAF_NOCLOBBER | EAF_NOESCAPE; case 'r': return EAF_NOCLOBBER | EAF_NOESCAPE; case 'W': return EAF_DIRECT | EAF_NOESCAPE; case 'w': return EAF_NOESCAPE; case '.': default: return 0; } }