From 51c925b3e95c8c4a01be43f16afa2a7eb064df82 Mon Sep 17 00:00:00 2001 From: Edgar E. Iglesias Date: Tue, 18 Oct 2011 00:20:58 +0200 Subject: [PATCH] microblaze: Avoid PC relative branches between sections Avoid PC relative branches between sections by further checking that the symbol we are calling is declared as a function before using PC relative calls. Changelog 2013-02-11 Edgar E. Iglesias * gcc/config/microblaze/microblaze.md (call_value_intern): Check symbol is function before branching Signed-off-by: Edgar E. Iglesias --- gcc/config/microblaze/microblaze.md | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md index 1d55a16..b3d0514 100644 --- a/gcc/config/microblaze/microblaze.md +++ b/gcc/config/microblaze/microblaze.md @@ -2128,9 +2128,17 @@ register rtx target = operands[1]; register rtx target2=gen_rtx_REG (Pmode,GP_REG_FIRST + MB_ABI_SUB_RETURN_ADDR_REGNUM); - if (GET_CODE (target) == SYMBOL_REF){ - gen_rtx_CLOBBER (VOIDmode,target2); - return "brlid\tr15,%1\;%#"; + if (GET_CODE (target) == SYMBOL_REF) + { + gen_rtx_CLOBBER (VOIDmode,target2); + if (SYMBOL_REF_FLAGS (target) & SYMBOL_FLAG_FUNCTION) + { + return "brlid\tr15,%1\;%#"; + } + else + { + return "bralid\tr15,%1\;%#"; + } } else if (GET_CODE (target) == CONST_INT) return "la\t%@,r0,%1\;brald\tr15,%@\;%#"; -- 1.7.3.2