public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 2/3] [ARC] DWARF emitting cleanup.
  2017-04-04 10:01 [PATCH 0/3] ARC patches series Claudiu Zissulescu
  2017-04-04 10:01 ` [PATCH 1/3] [ARC] Update mode_dependent_address_p hook Claudiu Zissulescu
@ 2017-04-04 10:01 ` Claudiu Zissulescu
  2017-04-04 10:02 ` [PATCH 3/3] [ARC] Use long jumps for CRT calls Claudiu Zissulescu
  2017-04-11 15:12 ` [PATCH 0/3] ARC patches series Andrew Burgess
  3 siblings, 0 replies; 6+ messages in thread
From: Claudiu Zissulescu @ 2017-04-04 10:01 UTC (permalink / raw)
  To: gcc-patches; +Cc: Claudiu.Zissulescu, Francois.Bedard, andrew.burgess

The use of CFA_FRAME_BASE_OFFSET and ARG_POINTER_CFA_OFFSET macros
leads to wrong offset calculation for DW_OP_fbreg constructions.
Remove them.

gcc/
2016-10-17  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/arc/arc-protos.h (arc_decl_pretend_args): Remove.
	* config/arc/arc.c (arc_decl_pretend_args): Likewise.
	* config/arc/arc.h (CFA_FRAME_BASE_OFFSET): Likewise.
	(ARG_POINTER_CFA_OFFSET): Likewise.
---
 gcc/config/arc/arc-protos.h |  1 -
 gcc/config/arc/arc.c        | 11 -----------
 gcc/config/arc/arc.h        |  5 -----
 3 files changed, 17 deletions(-)

diff --git a/gcc/config/arc/arc-protos.h b/gcc/config/arc/arc-protos.h
index 55a7bf7..4ff8e9b 100644
--- a/gcc/config/arc/arc-protos.h
+++ b/gcc/config/arc/arc-protos.h
@@ -109,7 +109,6 @@ extern int arc_label_align (rtx_insn *label);
 extern bool arc_need_delay (rtx_insn *insn);
 extern bool arc_text_label (rtx_insn *insn);
 
-extern int arc_decl_pretend_args (tree decl);
 extern bool arc_short_comparison_p (rtx, int);
 extern bool arc_epilogue_uses (int regno);
 extern bool arc_eh_uses (int regno);
diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
index 165f3d6..d8ac6a6 100644
--- a/gcc/config/arc/arc.c
+++ b/gcc/config/arc/arc.c
@@ -9470,17 +9470,6 @@ arc_text_label (rtx_insn *label)
   return false;
 }
 
-/* Return the size of the pretend args for DECL.  */
-
-int
-arc_decl_pretend_args (tree decl)
-{
-  /* struct function is in DECL_STRUCT_FUNCTION (decl), but no
-     pretend_args there...  See PR38391.  */
-  gcc_assert (decl == current_function_decl);
-  return crtl->args.pretend_args_size;
-}
-
 /* Without this, gcc.dg/tree-prof/bb-reorg.c fails to assemble
   when compiling with -O2 -freorder-blocks-and-partition -fprofile-use
   -D_PROFILE_USE; delay branch scheduling then follows a crossing jump
diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h
index 24c2346..0237e66 100644
--- a/gcc/config/arc/arc.h
+++ b/gcc/config/arc/arc.h
@@ -1584,11 +1584,6 @@ extern enum arc_function_type arc_compute_function_type (struct function *);
 
 #define INIT_EXPANDERS arc_init_expanders ()
 
-#define CFA_FRAME_BASE_OFFSET(FUNDECL) (-arc_decl_pretend_args ((FUNDECL)))
-
-#define ARG_POINTER_CFA_OFFSET(FNDECL) \
-  (FIRST_PARM_OFFSET (FNDECL) + arc_decl_pretend_args ((FNDECL)))
-
 enum
 {
   ARC_LRA_PRIORITY_NONE, ARC_LRA_PRIORITY_NONCOMPACT, ARC_LRA_PRIORITY_COMPACT
-- 
1.9.1

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

* [PATCH 1/3] [ARC] Update mode_dependent_address_p hook.
  2017-04-04 10:01 [PATCH 0/3] ARC patches series Claudiu Zissulescu
@ 2017-04-04 10:01 ` Claudiu Zissulescu
  2017-04-04 10:01 ` [PATCH 2/3] [ARC] DWARF emitting cleanup Claudiu Zissulescu
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Claudiu Zissulescu @ 2017-04-04 10:01 UTC (permalink / raw)
  To: gcc-patches; +Cc: Claudiu.Zissulescu, Francois.Bedard, andrew.burgess

Update arc_mode_dependent_address_p to avoid emitting subreg(mem (reg
..)) when expanding.

gcc/
2016-10-11  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/arc/arc.c (arc_mode_dependent_address_p): Relax
	conditions to take advantage of various optimizations.
---
 gcc/config/arc/arc.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
index 50bfa11..165f3d6 100644
--- a/gcc/config/arc/arc.c
+++ b/gcc/config/arc/arc.c
@@ -5641,13 +5641,9 @@ arc_mode_dependent_address_p (const_rtx addr, addr_space_t)
 {
   /* SYMBOL_REF is not mode dependent: it is either a small data reference,
      which is valid for loads and stores, or a limm offset, which is valid for
-     loads.  */
-  /* Scaled indices are scaled by the access mode; likewise for scaled
-     offsets, which are needed for maximum offset stores.  */
+     loads.  Scaled indices are scaled by the access mode.  */
   if (GET_CODE (addr) == PLUS
-      && (GET_CODE (XEXP ((addr), 0)) == MULT
-	  || (CONST_INT_P (XEXP ((addr), 1))
-	      && !SMALL_INT (INTVAL (XEXP ((addr), 1))))))
+      && GET_CODE (XEXP ((addr), 0)) == MULT)
     return true;
   return false;
 }
-- 
1.9.1

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

* [PATCH 0/3] ARC patches series
@ 2017-04-04 10:01 Claudiu Zissulescu
  2017-04-04 10:01 ` [PATCH 1/3] [ARC] Update mode_dependent_address_p hook Claudiu Zissulescu
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Claudiu Zissulescu @ 2017-04-04 10:01 UTC (permalink / raw)
  To: gcc-patches; +Cc: Claudiu.Zissulescu, Francois.Bedard, andrew.burgess

Hi Andrew,

Please find a number of small patches which are adding support to for CRT long calls, and fixes some errors when generating dwarf information and addresses.

Please let me know if more info is required,
Claudiu

Claudiu Zissulescu (3):
  [ARC] Update mode_dependent_address_p hook.
  [ARC] DWARF emitting cleanup.
  [ARC] Use long jumps for CRT calls

 gcc/config/arc/arc-protos.h |  1 -
 gcc/config/arc/arc.c        | 19 ++-----------------
 gcc/config/arc/arc.h        | 14 +++++---------
 3 files changed, 7 insertions(+), 27 deletions(-)

-- 
1.9.1

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

* [PATCH 3/3] [ARC] Use long jumps for CRT calls
  2017-04-04 10:01 [PATCH 0/3] ARC patches series Claudiu Zissulescu
  2017-04-04 10:01 ` [PATCH 1/3] [ARC] Update mode_dependent_address_p hook Claudiu Zissulescu
  2017-04-04 10:01 ` [PATCH 2/3] [ARC] DWARF emitting cleanup Claudiu Zissulescu
@ 2017-04-04 10:02 ` Claudiu Zissulescu
  2017-04-11 15:12 ` [PATCH 0/3] ARC patches series Andrew Burgess
  3 siblings, 0 replies; 6+ messages in thread
From: Claudiu Zissulescu @ 2017-04-04 10:02 UTC (permalink / raw)
  To: gcc-patches; +Cc: Claudiu.Zissulescu, Francois.Bedard, andrew.burgess

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

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

* Re: [PATCH 0/3] ARC patches series
  2017-04-04 10:01 [PATCH 0/3] ARC patches series Claudiu Zissulescu
                   ` (2 preceding siblings ...)
  2017-04-04 10:02 ` [PATCH 3/3] [ARC] Use long jumps for CRT calls Claudiu Zissulescu
@ 2017-04-11 15:12 ` Andrew Burgess
  2017-04-14 12:17   ` Claudiu Zissulescu
  3 siblings, 1 reply; 6+ messages in thread
From: Andrew Burgess @ 2017-04-11 15:12 UTC (permalink / raw)
  To: Claudiu Zissulescu; +Cc: gcc-patches, Francois.Bedard

* Claudiu Zissulescu <Claudiu.Zissulescu@synopsys.com> [2017-04-04 11:58:58 +0200]:

> Hi Andrew,
> 
> Please find a number of small patches which are adding support to for CRT long calls, and fixes some errors when generating dwarf information and addresses.
> 
> Please let me know if more info is required,
> Claudiu
> 
> Claudiu Zissulescu (3):
>   [ARC] Update mode_dependent_address_p hook.
>   [ARC] DWARF emitting cleanup.
>   [ARC] Use long jumps for CRT calls

These all look fine.

Thanks,
Andrew


> 
>  gcc/config/arc/arc-protos.h |  1 -
>  gcc/config/arc/arc.c        | 19 ++-----------------
>  gcc/config/arc/arc.h        | 14 +++++---------
>  3 files changed, 7 insertions(+), 27 deletions(-)
> 
> -- 
> 1.9.1
> 

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

* RE: [PATCH 0/3] ARC patches series
  2017-04-11 15:12 ` [PATCH 0/3] ARC patches series Andrew Burgess
@ 2017-04-14 12:17   ` Claudiu Zissulescu
  0 siblings, 0 replies; 6+ messages in thread
From: Claudiu Zissulescu @ 2017-04-14 12:17 UTC (permalink / raw)
  To: Andrew Burgess; +Cc: gcc-patches, Francois.Bedard

> > Claudiu Zissulescu (3):
> >   [ARC] Update mode_dependent_address_p hook.
> >   [ARC] DWARF emitting cleanup.
> >   [ARC] Use long jumps for CRT calls
> 
> These all look fine.
> 
Committed. Thank you for your review,
Claudiu

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

end of thread, other threads:[~2017-04-14 11:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-04 10:01 [PATCH 0/3] ARC patches series Claudiu Zissulescu
2017-04-04 10:01 ` [PATCH 1/3] [ARC] Update mode_dependent_address_p hook Claudiu Zissulescu
2017-04-04 10:01 ` [PATCH 2/3] [ARC] DWARF emitting cleanup Claudiu Zissulescu
2017-04-04 10:02 ` [PATCH 3/3] [ARC] Use long jumps for CRT calls Claudiu Zissulescu
2017-04-11 15:12 ` [PATCH 0/3] ARC patches series Andrew Burgess
2017-04-14 12:17   ` Claudiu Zissulescu

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).