From 33ec90c927fef40bdfc86554285ddaf5ff772d15 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Fri, 10 Mar 2017 22:45:32 +0800 Subject: Codegen C - Fix edge case with INT64_MIN --- src/trans/codegen_c.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src') 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 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, -- cgit v1.2.3