From: Claudiu Zissulescu <claz...@gmail.com>

BRcc instructions are generated quite late in the compilation
process. These instructions combines a compare with a regular
conditional branch if the result of the compare is not used
anylonger. However, when compiling for size, it is better to avoid
BRcc instructions which are introducing a 32-bit long immediate.

gcc/
2020-12-11  Claudiu Zissulescu  <claz...@synopsys.com>

        * config/arc/arc.c (arc_reorg): Avoid limm in BRcc.
---
 gcc/config/arc/arc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
index b80bb9b63a5..27bd458537b 100644
--- a/gcc/config/arc/arc.c
+++ b/gcc/config/arc/arc.c
@@ -8589,6 +8589,7 @@ arc_reorg (void)
                  if (!brcc_nolimm_operator (op, VOIDmode)
                      && !long_immediate_operand (op1, VOIDmode)
                      && (TARGET_ARC700
+                         || (TARGET_V2 && optimize_size)
                          || next_active_insn (link_insn) != insn))
                    continue;
 
-- 
2.26.2

Reply via email to