[Bug rtl-optimization/59639] Code in a cold basic block is not pushed to .text.unlikely
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59639 Andrew Pinski pinskia at gcc dot gnu.org changed: What|Removed |Added Component|tree-optimization |rtl-optimization --- Comment #1 from Andrew Pinski pinskia at gcc dot gnu.org --- The option you want is -freorder-blocks-and-partition but it only does something when there are real profiling info (aka -fprofile-generate/-fprofile-use).
[Bug rtl-optimization/59639] Code in a cold basic block is not pushed to .text.unlikely
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59639 --- Comment #2 from Avi Kivity a...@cloudius-systems.com --- (In reply to Andrew Pinski from comment #1) The option you want is -freorder-blocks-and-partition but it only does something when there are real profiling info (aka -fprofile-generate/-fprofile-use). No. The function slow_path() will be placed in .text.unlikely, without -freorder-blocks-and-partition, so gcc already knows about cold paths even without this option. Adding -freorder-blocks-and-partition does not change the output, even though gcc knows the probability even without profiling information. This is similar to __builtin_expect(), except that I cannot use __builtin_expect() with asm goto.
[Bug rtl-optimization/59639] Code in a cold basic block is not pushed to .text.unlikely
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59639 Andrew Pinski pinskia at gcc dot gnu.org changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|--- |DUPLICATE --- Comment #3 from Andrew Pinski pinskia at gcc dot gnu.org --- (In reply to Avi Kivity from comment #2) (In reply to Andrew Pinski from comment #1) The option you want is -freorder-blocks-and-partition but it only does something when there are real profiling info (aka -fprofile-generate/-fprofile-use). No. The function slow_path() will be placed in .text.unlikely, without -freorder-blocks-and-partition, so gcc already knows about cold paths even without this option. Adding -freorder-blocks-and-partition does not change the output, even though gcc knows the probability even without profiling information. As I said before, you need to use -fprofile-generate/-fprofile-use with that option. See bug 26493 which this is a duplicate of that one. This is similar to __builtin_expect(), except that I cannot use __builtin_expect() with asm goto. *** This bug has been marked as a duplicate of bug 26493 ***