On 5 Jun 2017, at 20:57, Jilles Tjoelker <jil...@stack.nl> wrote:
> 
> I would prefer using -ffreestanding or -fno-builtin only for the files
> which need it. For example, builtin memcpy() with a small constant size
> is useful to read and write data regardless of alignment and type-based
> aliasing restrictions. If the memcpy() becomes an external call, both
> code size and speed will be affected and the programmer will probably
> choose some other way such as unsafe pointer casts or reading one byte
> at a time.

In a non-freestanding environment, memcpy, memset, and memcmp calls are both 
translated early to LLVM intrinsics and then have special handling throughout 
the optimisation pipeline and in code generation.  We’re likely to pay a 
noticeable penalty in code size and performance if we don’t allow the compiler 
to do these, above and beyond the cost of the call.

David

_______________________________________________
freebsd-toolchain@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org"

Reply via email to