Normally Boolean options/flags in GCC take the values zero or one. This patch tweaks flag_trapping_math to take the values 0 or 65535. More accurately it introduces a new trapping_math_model enumeration in flag-types.h, and uses this to allow front-ends to (potentially) control which expressions may be constant folded at compile-time by the middle-end. Floating point/language experts may recognize these flags (bits) as being modelled upon (extended) FENV_ACCESS. This instalment simply introduces the necessary infrastructure without yet changing any functionality. The test "if (flag_trapping_math)" will remain perfectly valid (but pessimistic). The goal is to allow time for out-of-tree front-ends (modula-2, rust, etc.) to update themselves, if required, and to confirm that this change doesn't introduce problems for LTO, or elsewhere. This patch has been tested on x86_64-pc-linux-gnu with "make bootstrap" and "make -k check", all languages including Ada, with no new failures. Ok for mainline? 2021-09-25 Roger Sayle gcc/ChangeLog * flag-types.h (trapping_math_model): New enumeration (of bits) specifying possible floating-point (and integer) exceptions/traps. * common.opt (ftrapping-math): Specify UInteger and initialize to flag_trapping_math to TRAPPING_MATH_DEFAULT. * toplev.c (process_options): The option -fsignaling-nans should set flag_trapping_math to TRAPPING_MATH_DEFAULT. gcc/ada/ChangeLog * gcc-interface/misc.c (gnat_init_gcc_fp): Set flag_trapping_math to TRAPPING_MATH_DEFAULT (instead of 1) if S'Machine_Overflow. Roger --