Why doesn't GCC use built-in features in strict mode?

GCC disables many of the built-in features in strict mode -std=c....

External strict ISO C mode (-ansi, -std = c90, -std = c99 or -std = c11), _exit, alloca, bcmp, bzero ... stpcpy, ... functions can be treated as built-in functions. All these functions have corresponding versions with the _builtin prefix, which can be used even in strict C90 mode.

Is there a reason for this? Are the buildings inappropriate? Or is it because the standard says that when you call memcpy, it should really call it and that I cannot optimize?

I feel that my code can certainly work faster if I recompiled it with -std=gnu*, because it would allow more optimization

GCC usually generates special code to handle certain built-in functions more efficiently; for example, alloca calls can separate instructions that directly configure the stack, and calls to memcpy can become inline copy paths

+3
source share
1 answer

None of the _exit, alloca, bcmp, bzero, stpcpyor any of the other functions in this list are not defined in the C standard, so they should not be determined by the appropriate C compiler; these names should be available to the user for their own identifiers.

, - ISO. , memcpy " [a] [], -fno-builtin"

+4

All Articles