This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/59663] New: [4.9 Regression] config/darwin.c:3665:1: error: control reaches end of non-void function [-Werror=return-type]


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59663

            Bug ID: 59663
           Summary: [4.9 Regression] config/darwin.c:3665:1: error:
                    control reaches end of non-void function
                    [-Werror=return-type]
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: build
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
                CC: hubicka at gcc dot gnu.org, marxin.liska at gmail dot com
            Target: *-*-darwin*

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;
+      }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]