bpf_expand_cpymem (rtx *operands, bool is_move)
{
/* Size must be constant for this expansion to work. */
+ const char *name = is_move ? "memmove" : "memcpy";
if (!CONST_INT_P (operands[2]))
{
- const char *name = is_move ? "memmove" : "memcpy";
if (flag_building_libgcc)
warning (0, "could not inline call to %<__builtin_%s%>: "
"size must be constant", name);
gcc_unreachable ();
}
+ /* For sizes above threshold, always use a libcall. */
+ if (size_bytes > (unsigned HOST_WIDE_INT) bpf_inline_memops_threshold)
+ {
+ if (flag_building_libgcc)
+ warning (0, "could not inline call to %<__builtin_%s%>: "
+ "too many bytes, use %<-minline-memops-threshold%>", name);
+ else
+ error ("could not inline call to %<__builtin_%s%>: "
+ "too many bytes, use %<-minline-memops-threshold%>", name);
+ return false;
+ }
+
unsigned iters = size_bytes >> ceil_log2 (align);
unsigned remainder = size_bytes & (align - 1);
gcc_unreachable ();
}
+ /* For sizes above threshold, always use a libcall. */
+ if (size_bytes > (unsigned HOST_WIDE_INT) bpf_inline_memops_threshold)
+ {
+ if (flag_building_libgcc)
+ warning (0, "could not inline call to %<__builtin_memset%>: "
+ "too many bytes, use %<-minline-memops-threshold%>");
+ else
+ error ("could not inline call to %<__builtin_memset%>: "
+ "too many bytes, use %<-minline-memops-threshold%>");
+ return false;
+ }
+
unsigned iters = size_bytes >> ceil_log2 (align);
unsigned remainder = size_bytes & (align - 1);
unsigned inc = GET_MODE_SIZE (mode);
@gccoptlist{-mbig-endian -mlittle-endian
-mframe-limit=@var{bytes} -mxbpf -mco-re -mno-co-re -mjmpext
-mjmp32 -malu32 -mv3-atomics -mbswap -msdiv -msmov -mcpu=@var{version}
--masm=@var{dialect}}
+-masm=@var{dialect} -minline-memops-threshold=@var{bytes}}
@emph{FR30 Options}
@gccoptlist{-msmall-model -mno-lsim}
@end table
+@opindex -minline-memops-threshold
+@item -minline-memops-threshold=@var{bytes}
+Specifies a size threshold in bytes at or below which memmove, memcpy
+and memset shall always be expanded inline. Operations dealing with
+sizes larger than this threshold would have to be be implemented using
+a library call instead of being expanded inline, but since BPF doesn't
+allow libcalls, exceeding this threshold results in a compile-time
+error. The default is @samp{1024} bytes.
+
@end table
@node FR30 Options