public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Disable -mbranch-likely for -Os when targetting generic architecture
@ 2015-08-14 13:14 Robert Suchanek
  2015-08-20 20:15 ` Richard Sandiford
  0 siblings, 1 reply; 8+ messages in thread
From: Robert Suchanek @ 2015-08-14 13:14 UTC (permalink / raw)
  To: Matthew Fortune, Catherine_Moore; +Cc: gcc-patches

Hi,

The patch below disables generation of the branch likely instructions for -Os
but only for generic architecture.  The branch likely may result in some
code size reduction but the cost of running the code on R6 core is significant.

Disabling this for generic architecture would therefore be desirable for now.

Ok to apply?

Regards,
Robert

gcc/
	* mips.c (mips_option_override): Enable branch likely for non-generic
	architecture.
---
 gcc/config/mips/mips.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index a9829bd..68def06 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -19564,7 +19564,7 @@ mips_option_override (void)
   if ((target_flags_explicit & MASK_BRANCHLIKELY) == 0)
     {
       if (ISA_HAS_BRANCHLIKELY
-	  && (optimize_size
+	  && ((optimize_size && strncmp (mips_arch_info->name, "mips", 4) != 0)
 	      || (mips_tune_info->tune_flags & PTF_AVOID_BRANCHLIKELY) == 0))
 	target_flags |= MASK_BRANCHLIKELY;
       else
-- 
2.4.5

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-10-11  8:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-14 13:14 [PATCH] Disable -mbranch-likely for -Os when targetting generic architecture Robert Suchanek
2015-08-20 20:15 ` Richard Sandiford
2015-08-20 21:52   ` Matthew Fortune
2015-09-04 14:29     ` Robert Suchanek
2015-10-22 19:09       ` Moore, Catherine
2016-05-24 15:35         ` Robert Suchanek
2016-09-21 13:32           ` Matthew Fortune
2016-10-11  8:00             ` Robert Suchanek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).