diff options
author | John Hodge <tpg@ucc.asn.au> | 2017-03-10 22:45:32 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2017-03-10 22:45:32 +0800 |
commit | 33ec90c927fef40bdfc86554285ddaf5ff772d15 (patch) | |
tree | 3cb97afea9a3926cb660d9e91c45c5828c2a6cf1 | |
parent | efa36493b124d5819d2f9687de979af3dc637817 (diff) | |
download | mrust-33ec90c927fef40bdfc86554285ddaf5ff772d15.tar.gz |
Codegen C - Fix edge case with INT64_MIN
-rw-r--r-- | src/trans/codegen_c.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/trans/codegen_c.cpp b/src/trans/codegen_c.cpp index d147e5f8..08cf3ac7 100644 --- a/src/trans/codegen_c.cpp +++ b/src/trans/codegen_c.cpp @@ -134,6 +134,7 @@ namespace { ::std::vector<::std::string> tmp; ::std::vector<const char*> args; args.push_back( getenv("CC") ? getenv("CC") : "gcc" ); + args.push_back("-ffunction-sections"); args.push_back("-pthread"); switch(opt.opt_level) { @@ -2802,15 +2803,17 @@ namespace { if( c.v == INT64_MIN ) m_of << "INT64_MIN"; else - m_of << c.v; - switch(c.t) { - case ::HIR::CoreType::I64: - case ::HIR::CoreType::I128: - case ::HIR::CoreType::Isize: - m_of << "ull"; - default: - break; + m_of << c.v; + switch(c.t) + { + case ::HIR::CoreType::I64: + case ::HIR::CoreType::I128: + case ::HIR::CoreType::Isize: + m_of << "ull"; + default: + break; + } } ), (Uint, |