On 7/23/23 14:45, Julian Waters via Gcc-help wrote:
Hi all, Is there a way to stop gcc from nuking an if (false) statement and the corresponding branch from the compiled code for debugging purposes? Even turning off all optimizations doesn't achieve this best regards, Julian
IMO the simplest way would be to define something like `static const volatile bool unoptimizable_false = false;` somewhere and use it in place of `false`, when you want to avoid the if statement being optimized out.