I did write a patch to substitute in __aeabi_memset and _aeabi_memclr calls in builtin.c:expand_builtin_memset_args, but it was unsuccessful.
Firstly, expand_builtin_memset_args is not the only place memset calls come from. Other places include expr.c:block_clear_fn.
Secondly, __aeabi_memset has it's arguments in a non-standard order, so it's not enough to just change the function name - there needs to be some kind of target hook to configure the order.
Thirdly, there is at least one place that assumes it knows what the arguments to memset mean (dse.c:scan_insn), so they'd need to be adjusted.
Fourthly, there doesn't seem to be any central place that defines what the memset call should be. The name seems to be hardcoded in a few places. Actually, libfuncs.h does define one, but nothing seems to use it (although a few places do override it).
I did write a patch to substitute in __aeabi_memset and _aeabi_memclr calls in builtin. c:expand_ builtin_ memset_ args, but it was unsuccessful.
Firstly, expand_ builtin_ memset_ args is not the only place memset calls come from. Other places include expr.c: block_clear_ fn.
Secondly, __aeabi_memset has it's arguments in a non-standard order, so it's not enough to just change the function name - there needs to be some kind of target hook to configure the order.
Thirdly, there is at least one place that assumes it knows what the arguments to memset mean (dse.c:scan_insn), so they'd need to be adjusted.
Fourthly, there doesn't seem to be any central place that defines what the memset call should be. The name seems to be hardcoded in a few places. Actually, libfuncs.h does define one, but nothing seems to use it (although a few places do override it).