Bug 59663 - [4.9 Regression] Bootstrap failure: config/darwin.c:3665:1: error: control reaches end of non-void function [-Werror=return-type]
Summary: [4.9 Regression] Bootstrap failure: config/darwin.c:3665:1: error: control re...
Status: RESOLVED DUPLICATE of bug 59541
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.9.0
: P3 normal
Target Milestone: 4.9.0
Assignee: Not yet assigned to anyone
URL:
Keywords: build
Depends on:
Blocks:
 
Reported: 2014-01-03 09:14 UTC by Tobias Burnus
Modified: 2014-01-04 18:47 UTC (History)
1 user (show)

See Also:
Host:
Target: *-*-darwin*
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Burnus 2014-01-03 09:14:35 UTC
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;
+      }
Comment 1 Tobias Burnus 2014-01-04 18:40:35 UTC
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:
Comment 2 Dominique d'Humieres 2014-01-04 18:47:59 UTC
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 ***