summaryrefslogtreecommitdiff
path: root/experimental/mrustc/mrustc-0006-Codegen-C-Turn-down-gcc-optimisation-level-to-work-a.patch
blob: f84c19b445d2e3f7825ceb9522de05c9e93ecf60 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
From 994ddf817a554c48ae03840c8aaf82fb99ab5d27 Mon Sep 17 00:00:00 2001
From: John Hodge <tpg@mutabah.net>
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