public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 1/2] [ARC] Fix REG_CLASS_NAMES
  2018-12-11 10:23 [PATCH 0/2][ARC] Fixes needed for the upcomming release Claudiu Zissulescu
  2018-12-11 10:23 ` [PATCH 2/2] [ARC] Fix millicode wrong blink restore Claudiu Zissulescu
@ 2018-12-11 10:23 ` Claudiu Zissulescu
  2018-12-12 16:16   ` Andrew Burgess
  2018-12-14 10:45 ` [PATCH 0/2][ARC] Fixes needed for the upcomming release Claudiu Zissulescu
  2 siblings, 1 reply; 6+ messages in thread
From: Claudiu Zissulescu @ 2018-12-11 10:23 UTC (permalink / raw)
  To: gcc-patches; +Cc: fbedard, claziss, andrew.burgess

Forgot a class name, fix it.

gcc/
xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/arc/arc.h (REG_CLASS_NAMES): Add SIBCALL_REGS.


---
 gcc/config/arc/arc.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h
index 4d01c99a540..80e785e6562 100644
--- a/gcc/config/arc/arc.h
+++ b/gcc/config/arc/arc.h
@@ -491,6 +491,7 @@ enum reg_class
   "R0R1_CD_REGS",	  \
   "R0R3_CD_REGS",	  \
   "ARCOMPACT16_REGS",	  \
+  "SIBCALL_REGS",	  \
   "AC16_H_REGS",	  \
   "DOUBLE_REGS",	  \
   "GENERAL_REGS",	  \
-- 
2.19.1

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

* [PATCH 2/2] [ARC] Fix millicode wrong blink restore.
  2018-12-11 10:23 [PATCH 0/2][ARC] Fixes needed for the upcomming release Claudiu Zissulescu
@ 2018-12-11 10:23 ` Claudiu Zissulescu
  2018-12-12 16:18   ` Andrew Burgess
  2018-12-11 10:23 ` [PATCH 1/2] [ARC] Fix REG_CLASS_NAMES Claudiu Zissulescu
  2018-12-14 10:45 ` [PATCH 0/2][ARC] Fixes needed for the upcomming release Claudiu Zissulescu
  2 siblings, 1 reply; 6+ messages in thread
From: Claudiu Zissulescu @ 2018-12-11 10:23 UTC (permalink / raw)
  To: gcc-patches; +Cc: fbedard, claziss, andrew.burgess

The blink is restored wrongly when using millicode and regular load
instructions.

gcc/
xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/arc/arc.c (arc_restore_callee_milli) Don't clobber off
	variable.

testsuite/
xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

	* gcc.target/arc/milli-1.c: New test.
---
 gcc/config/arc/arc.c                   |  4 +---
 gcc/testsuite/gcc.target/arc/milli-1.c | 23 +++++++++++++++++++++++
 2 files changed, 24 insertions(+), 3 deletions(-)
 create mode 100644 gcc/testsuite/gcc.target/arc/milli-1.c

diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
index 55175215bfe..5af3ee6c9e0 100644
--- a/gcc/config/arc/arc.c
+++ b/gcc/config/arc/arc.c
@@ -3597,9 +3597,7 @@ arc_restore_callee_milli (unsigned int gmask,
     insn = frame_insn (insn);
 
   /* Add DWARF info.  */
-  for (regno = start_reg, off = 0;
-       regno <= end_reg;
-       regno++, off += UNITS_PER_WORD)
+  for (regno = start_reg; regno <= end_reg; regno++)
     {
       reg = gen_rtx_REG (SImode, regno);
       add_reg_note (insn, REG_CFA_RESTORE, reg);
diff --git a/gcc/testsuite/gcc.target/arc/milli-1.c b/gcc/testsuite/gcc.target/arc/milli-1.c
new file mode 100644
index 00000000000..b501b39eb81
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arc/milli-1.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-Os" } */
+
+/* Test if we restore correctly blink when using millicode.  */
+extern void bar (void);
+
+void foo (void)
+{
+  __asm__ volatile ( "" : : : "r13","r14","r15","r16","r17","r18","r20","r21");
+  bar();
+}
+
+void foo2 (void)
+{
+  bar();
+  __asm__ volatile ( "" : : : "r13","r14","r15","r16","r17","r18","r20","r21");
+}
+
+/* { dg-final { scan-assembler-not "st.*r13,\\\[sp" } } */
+/* { dg-final { scan-assembler-not "st.*r14,\\\[sp" } } */
+/* { dg-final { scan-assembler-not "st.*r15,\\\[sp" } } */
+/* { dg-final { scan-assembler "ld.*blink,\\\[sp,32" } } */
+/* { dg-final { scan-assembler "mov_s.*r12,32" } } */
-- 
2.19.1

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

* [PATCH 0/2][ARC] Fixes needed for the upcomming release.
@ 2018-12-11 10:23 Claudiu Zissulescu
  2018-12-11 10:23 ` [PATCH 2/2] [ARC] Fix millicode wrong blink restore Claudiu Zissulescu
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Claudiu Zissulescu @ 2018-12-11 10:23 UTC (permalink / raw)
  To: gcc-patches; +Cc: fbedard, claziss, andrew.burgess

Hi Andrew,

Please find two small patches which are fixing a number of issues found in the upcomming release.

Ok to apply?
Claudiu

Claudiu Zissulescu (2):
  [ARC] Fix REG_CLASS_NAMES
  [ARC] Fix millicode wrong blink restore.

 gcc/config/arc/arc.c                   |  4 +---
 gcc/config/arc/arc.h                   |  1 +
 gcc/testsuite/gcc.target/arc/milli-1.c | 23 +++++++++++++++++++++++
 3 files changed, 25 insertions(+), 3 deletions(-)
 create mode 100644 gcc/testsuite/gcc.target/arc/milli-1.c

-- 
2.19.1

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

* Re: [PATCH 1/2] [ARC] Fix REG_CLASS_NAMES
  2018-12-11 10:23 ` [PATCH 1/2] [ARC] Fix REG_CLASS_NAMES Claudiu Zissulescu
@ 2018-12-12 16:16   ` Andrew Burgess
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Burgess @ 2018-12-12 16:16 UTC (permalink / raw)
  To: Claudiu Zissulescu; +Cc: gcc-patches, fbedard, claziss

* Claudiu Zissulescu <claziss@gmail.com> [2018-12-11 12:23:34 +0200]:

> Forgot a class name, fix it.
> 
> gcc/
> xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>
> 
> 	* config/arc/arc.h (REG_CLASS_NAMES): Add SIBCALL_REGS.

Looks good,

Thanks,
Andrew

> 
> 
> ---
>  gcc/config/arc/arc.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h
> index 4d01c99a540..80e785e6562 100644
> --- a/gcc/config/arc/arc.h
> +++ b/gcc/config/arc/arc.h
> @@ -491,6 +491,7 @@ enum reg_class
>    "R0R1_CD_REGS",	  \
>    "R0R3_CD_REGS",	  \
>    "ARCOMPACT16_REGS",	  \
> +  "SIBCALL_REGS",	  \
>    "AC16_H_REGS",	  \
>    "DOUBLE_REGS",	  \
>    "GENERAL_REGS",	  \
> -- 
> 2.19.1
> 

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

* Re: [PATCH 2/2] [ARC] Fix millicode wrong blink restore.
  2018-12-11 10:23 ` [PATCH 2/2] [ARC] Fix millicode wrong blink restore Claudiu Zissulescu
@ 2018-12-12 16:18   ` Andrew Burgess
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Burgess @ 2018-12-12 16:18 UTC (permalink / raw)
  To: Claudiu Zissulescu; +Cc: gcc-patches, fbedard, claziss

* Claudiu Zissulescu <claziss@gmail.com> [2018-12-11 12:23:35 +0200]:

> The blink is restored wrongly when using millicode and regular load
> instructions.
> 
> gcc/
> xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>
> 
> 	* config/arc/arc.c (arc_restore_callee_milli) Don't clobber off
> 	variable.
> 
> testsuite/
> xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>
> 
> 	* gcc.target/arc/milli-1.c: New test.

Looks good, and thanks for the new test.

Andrew


> ---
>  gcc/config/arc/arc.c                   |  4 +---
>  gcc/testsuite/gcc.target/arc/milli-1.c | 23 +++++++++++++++++++++++
>  2 files changed, 24 insertions(+), 3 deletions(-)
>  create mode 100644 gcc/testsuite/gcc.target/arc/milli-1.c
> 
> diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
> index 55175215bfe..5af3ee6c9e0 100644
> --- a/gcc/config/arc/arc.c
> +++ b/gcc/config/arc/arc.c
> @@ -3597,9 +3597,7 @@ arc_restore_callee_milli (unsigned int gmask,
>      insn = frame_insn (insn);
>  
>    /* Add DWARF info.  */
> -  for (regno = start_reg, off = 0;
> -       regno <= end_reg;
> -       regno++, off += UNITS_PER_WORD)
> +  for (regno = start_reg; regno <= end_reg; regno++)
>      {
>        reg = gen_rtx_REG (SImode, regno);
>        add_reg_note (insn, REG_CFA_RESTORE, reg);
> diff --git a/gcc/testsuite/gcc.target/arc/milli-1.c b/gcc/testsuite/gcc.target/arc/milli-1.c
> new file mode 100644
> index 00000000000..b501b39eb81
> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/arc/milli-1.c
> @@ -0,0 +1,23 @@
> +/* { dg-do compile } */
> +/* { dg-options "-Os" } */
> +
> +/* Test if we restore correctly blink when using millicode.  */
> +extern void bar (void);
> +
> +void foo (void)
> +{
> +  __asm__ volatile ( "" : : : "r13","r14","r15","r16","r17","r18","r20","r21");
> +  bar();
> +}
> +
> +void foo2 (void)
> +{
> +  bar();
> +  __asm__ volatile ( "" : : : "r13","r14","r15","r16","r17","r18","r20","r21");
> +}
> +
> +/* { dg-final { scan-assembler-not "st.*r13,\\\[sp" } } */
> +/* { dg-final { scan-assembler-not "st.*r14,\\\[sp" } } */
> +/* { dg-final { scan-assembler-not "st.*r15,\\\[sp" } } */
> +/* { dg-final { scan-assembler "ld.*blink,\\\[sp,32" } } */
> +/* { dg-final { scan-assembler "mov_s.*r12,32" } } */
> -- 
> 2.19.1
> 

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

* RE: [PATCH 0/2][ARC] Fixes needed for the upcomming release.
  2018-12-11 10:23 [PATCH 0/2][ARC] Fixes needed for the upcomming release Claudiu Zissulescu
  2018-12-11 10:23 ` [PATCH 2/2] [ARC] Fix millicode wrong blink restore Claudiu Zissulescu
  2018-12-11 10:23 ` [PATCH 1/2] [ARC] Fix REG_CLASS_NAMES Claudiu Zissulescu
@ 2018-12-14 10:45 ` Claudiu Zissulescu
  2 siblings, 0 replies; 6+ messages in thread
From: Claudiu Zissulescu @ 2018-12-14 10:45 UTC (permalink / raw)
  To: gcc-patches; +Cc: francois.bedard, andrew.burgess

Thank you Andrew for your quick review. Both patches are committed.

Claudiu
________________________________________
From: Claudiu Zissulescu [claziss@gmail.com]
Sent: Tuesday, December 11, 2018 11:23 AM
To: gcc-patches@gcc.gnu.org
Cc: francois.bedard@synopsys.com; claudiu.zissulescu@synopsys.com; andrew.burgess@embecosm.com
Subject: [PATCH 0/2][ARC] Fixes needed for the upcomming release.

Hi Andrew,

Please find two small patches which are fixing a number of issues found in the upcomming release.

Ok to apply?
Claudiu

Claudiu Zissulescu (2):
  [ARC] Fix REG_CLASS_NAMES
  [ARC] Fix millicode wrong blink restore.

 gcc/config/arc/arc.c                   |  4 +---
 gcc/config/arc/arc.h                   |  1 +
 gcc/testsuite/gcc.target/arc/milli-1.c | 23 +++++++++++++++++++++++
 3 files changed, 25 insertions(+), 3 deletions(-)
 create mode 100644 gcc/testsuite/gcc.target/arc/milli-1.c

--
2.19.1

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

end of thread, other threads:[~2018-12-14 10:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-11 10:23 [PATCH 0/2][ARC] Fixes needed for the upcomming release Claudiu Zissulescu
2018-12-11 10:23 ` [PATCH 2/2] [ARC] Fix millicode wrong blink restore Claudiu Zissulescu
2018-12-12 16:18   ` Andrew Burgess
2018-12-11 10:23 ` [PATCH 1/2] [ARC] Fix REG_CLASS_NAMES Claudiu Zissulescu
2018-12-12 16:16   ` Andrew Burgess
2018-12-14 10:45 ` [PATCH 0/2][ARC] Fixes needed for the upcomming release 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).