"-ftrapv" and "-fwrapv": which is better for efficiency?

On the GNU website:

-ftrapv
This option generates traps for signed overflow on addition, subtraction, multiplication operations. 
-fwrapv
This option instructs the compiler to assume that signed arithmetic overflow of addition, subtraction and multiplication wraps around using twos-complement representation. This flag enables some optimizations and disables others.

I have two questions. 1) Which of these options is better for performance? 2) What does it mean when a definition -ftrapvsays that it generates "traps"? Does this mean exceptions? (I suppose not, but it's worth asking.)

Source: https://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Code-Gen-Options.html

+4
source share
2 answers

, , . , , , , , .

, -ftrapv , ""? ?

++. , , x86, , GCC SIGABRT, . CPU, . , , , , .

+6

, , , . , UB , , , , - , , .

, , , , , UB, , -fwrapv, , -fwrapv. , , " , ", gcc .

, ( - - , ), , . , , .

0

Source: https://habr.com/ru/post/1651314/