public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Claudiu Zissulescu <Claudiu.Zissulescu@synopsys.com>
To: <gcc-patches@gcc.gnu.org>
Cc: <Claudiu.Zissulescu@synopsys.com>,	<Francois.Bedard@synopsys.com>,
	<andrew.burgess@embecosm.com>
Subject: [PATCH 3/3] [ARC] Use long jumps for CRT calls
Date: Tue, 04 Apr 2017 10:02:00 -0000	[thread overview]
Message-ID: <1491299941-3908-4-git-send-email-claziss@synopsys.com> (raw)
In-Reply-To: <1491299941-3908-1-git-send-email-claziss@synopsys.com>

There are situations when the range offered by the bl instruction is
not sufficient to reach CRT routines. Thus, use a long jump
construction.

gcc/
2016-04-21  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/arc/arc.h (CRT_CALL_STATIC_FUNCTION): Use long calls.
---
 gcc/config/arc/arc.h | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h
index 0237e66..0c7e561 100644
--- a/gcc/config/arc/arc.h
+++ b/gcc/config/arc/arc.h
@@ -1518,10 +1518,11 @@ extern enum arc_function_type arc_compute_function_type (struct function *);
 /* Called by crtstuff.c to make calls to function FUNCTION that are defined in
    SECTION_OP, and then to switch back to text section.  */
 #undef CRT_CALL_STATIC_FUNCTION
-#define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
-    asm (SECTION_OP "\n\t"				\
-	"bl @" USER_LABEL_PREFIX #FUNC "\n"		\
-	TEXT_SECTION_ASM_OP);
+#define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC)		\
+  asm (SECTION_OP "\n\t"					\
+       "add r12,pcl,@" USER_LABEL_PREFIX #FUNC "@pcl\n\t"	\
+       "jl  [r12]\n"						\
+       TEXT_SECTION_ASM_OP);
 
 /* This macro expands to the name of the scratch register r12, used for
    temporary calculations according to the ABI.  */
-- 
1.9.1

  parent reply	other threads:[~2017-04-04 10:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-04 10:01 [PATCH 0/3] ARC patches series Claudiu Zissulescu
2017-04-04 10:01 ` [PATCH 2/3] [ARC] DWARF emitting cleanup Claudiu Zissulescu
2017-04-04 10:01 ` [PATCH 1/3] [ARC] Update mode_dependent_address_p hook Claudiu Zissulescu
2017-04-04 10:02 ` Claudiu Zissulescu [this message]
2017-04-11 15:12 ` [PATCH 0/3] ARC patches series Andrew Burgess
2017-04-14 12:17   ` Claudiu Zissulescu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1491299941-3908-4-git-send-email-claziss@synopsys.com \
    --to=claudiu.zissulescu@synopsys.com \
    --cc=Francois.Bedard@synopsys.com \
    --cc=andrew.burgess@embecosm.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).