From 994ddf817a554c48ae03840c8aaf82fb99ab5d27 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Mon, 16 Dec 2024 20:09:09 +0800 Subject: [PATCH 6/6] Codegen C - Turn down gcc optimisation level to work around #347 diff --git a/src/trans/codegen_c.cpp b/src/trans/codegen_c.cpp index c40a8d98..6a3cdf25 100644 --- a/src/trans/codegen_c.cpp +++ b/src/trans/codegen_c.cpp @@ -1282,7 +1282,8 @@ namespace { args.push_back("-O1"); break; case 2: - args.push_back("-O2"); + //args.push_back("-O2"); + args.push_back("-O1"); // HACK: Work around mrustc #347 by reducing the optimisation level break; } // HACK: Work around [https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117423] by disabling an optimisation stage -- 2.40.0