re PR target/35661 (__attribute__((cold)) generates wrong code)
authorZuxy Meng <zuxy.meng@gmail.com>
Mon, 14 Apr 2008 23:47:39 +0000 (23:47 +0000)
committerDanny Smith <dannysmith@gcc.gnu.org>
Mon, 14 Apr 2008 23:47:39 +0000 (23:47 +0000)
2008-04-16  Zuxy Meng  <zuxy.meng@gmail.com>

PR target/35661
* config/i386/winnt.c (i386_pe_section_type_flags): Mark
".text.unlikely" section as executable.

From-SVN: r134296

gcc/ChangeLog
gcc/config/i386/winnt.c

index e32aeeaa88f88538f6b06ee64d1cefb83fabde12..0109eadc12564c54d2cd81e68a01c5c1de78859a 100644 (file)
@@ -1,3 +1,9 @@
+2008-04-16  Zuxy Meng  <zuxy.meng@gmail.com>
+
+       PR target/35661
+       * config/i386/winnt.c (i386_pe_section_type_flags): Mark
+       ".text.unlikely" section as executable.
+
 2008-04-14  James E. Wilson  <wilson@tuliptree.org>
 
        * config/ia64/ia64.c (rtx_needs_barrier): Handle
index 4d93573506ee6b67c754ce19053ac38738d91fcd..35d7f9f9eaceb1136f492f670c942d9860fafded 100644 (file)
@@ -420,6 +420,15 @@ i386_pe_section_type_flags (tree decl, const char *name, int reloc)
     flags = SECTION_CODE;
   else if (decl && decl_readonly_section (decl, reloc))
     flags = 0;
+  else if (current_function_decl
+          && cfun
+          && crtl->subsections.unlikely_text_section_name
+          && strcmp (name, crtl->subsections.unlikely_text_section_name) == 0)
+    flags = SECTION_CODE;
+  else if (!decl
+          && (!current_function_decl || !cfun)
+          && strcmp (name, UNLIKELY_EXECUTED_TEXT_SECTION_NAME) == 0)
+    flags = SECTION_CODE;
   else
     {
       flags = SECTION_WRITE;