Cf. https://trac.macports.org/ticket/41964 and PR59654 comment 20. gcc/config/darwin.c: In function 'section* darwin_function_section(tree, node_frequency, bool, bool)': gcc/config/darwin.c:3665:1: error: control reaches end of non-void function [-Werror=return-type] } I think the culprit is Martin's patch r206070 - as there is no return after the "switch": @@ -3642,6 +3649,11 @@ darwin_function_section (tree decl, enum node_frequency case NODE_FREQUENCY_HOT: - return (weak) - ? darwin_sections[text_hot_coal_section] - : darwin_sections[text_hot_section]; - break; + { + /* If we do have a profile or(and) LTO phase is executed, we do not need + these ELF section. */ + if (!in_lto_p || !flag_profile_values) + return (weak) + ? darwin_sections[text_hot_coal_section] + : darwin_sections[text_hot_section]; + break; + }
Draft patch – I have no idea about that code part, but the following patch mimics what code before the switch statement. diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c index 63a385c..bb787f0 100644 --- a/gcc/config/darwin.c +++ b/gcc/config/darwin.c @@ -3654,6 +3654,8 @@ darwin_function_section (tree decl, enum node_frequency freq, return (weak) ? darwin_sections[text_hot_coal_section] : darwin_sections[text_hot_section]; + else + return text_section; break; } default:
Duplicate of pr59541. See http://gcc.gnu.org/ml/gcc-testresults/2013-12/msg02179.html for a better patch. Iain Sandoe should submit something along this line soon(?). *** This bug has been marked as a duplicate of bug 59541 ***