From: Zuxy Meng Date: Mon, 14 Apr 2008 23:47:39 +0000 (+0000) Subject: re PR target/35661 (__attribute__((cold)) generates wrong code) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=40f39798cea1409910ee900f17a37944eea0f7b7;p=gcc.git re PR target/35661 (__attribute__((cold)) generates wrong code) 2008-04-16 Zuxy Meng PR target/35661 * config/i386/winnt.c (i386_pe_section_type_flags): Mark ".text.unlikely" section as executable. From-SVN: r134296 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e32aeeaa88f..0109eadc125 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-04-16 Zuxy Meng + + PR target/35661 + * config/i386/winnt.c (i386_pe_section_type_flags): Mark + ".text.unlikely" section as executable. + 2008-04-14 James E. Wilson * config/ia64/ia64.c (rtx_needs_barrier): Handle diff --git a/gcc/config/i386/winnt.c b/gcc/config/i386/winnt.c index 4d93573506e..35d7f9f9eac 100644 --- a/gcc/config/i386/winnt.c +++ b/gcc/config/i386/winnt.c @@ -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;