Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/gnu/dist/gcc4/gcc/config/vax Add a register definition for t...



details:   https://anonhg.NetBSD.org/src/rev/cbd7042f2212
branches:  trunk
changeset: 794599:cbd7042f2212
user:      joerg <joerg%NetBSD.org@localhost>
date:      Tue Mar 18 23:43:40 2014 +0000

description:
Add a register definition for the Processor Status Word on VAX.
Change the unwind definition to specify the CFA base via %fp before
using it in the various register locations.

diffstat:

 gnu/dist/gcc4/gcc/config/vax/vax.c  |  22 ++++++++++++++--------
 gnu/dist/gcc4/gcc/config/vax/vax.h  |   3 +++
 gnu/dist/gcc4/gcc/config/vax/vax.md |   1 +
 3 files changed, 18 insertions(+), 8 deletions(-)

diffs (58 lines):

diff -r 8787e2e577b3 -r cbd7042f2212 gnu/dist/gcc4/gcc/config/vax/vax.c
--- a/gnu/dist/gcc4/gcc/config/vax/vax.c        Tue Mar 18 23:43:38 2014 +0000
+++ b/gnu/dist/gcc4/gcc/config/vax/vax.c        Tue Mar 18 23:43:40 2014 +0000
@@ -124,16 +124,22 @@
   if (dwarf2out_do_frame ())
     {
       const char *label = dwarf2out_cfi_label ();
-      int offset = 0;
+      int offset;
+
+      offset = -20;
+      for (regno = 0; regno < FIRST_PSEUDO_REGISTER; ++regno)
+        if (regs_ever_live[regno] && !call_used_regs[regno])
+          offset -= 4;
 
-      for (regno = FIRST_PSEUDO_REGISTER-1; regno >= 0; --regno)
-       if (regs_ever_live[regno] && !call_used_regs[regno])
-         dwarf2out_reg_save (label, regno, offset -= 4);
+      dwarf2out_def_cfa (label, FRAME_POINTER_REGNUM, -offset);
+      dwarf2out_reg_save (label, PSW_REGNUM, offset += 4);
+      dwarf2out_reg_save (label, ARG_POINTER_REGNUM, offset += 4);
+      dwarf2out_reg_save (label, FRAME_POINTER_REGNUM, offset += 4);
+      dwarf2out_reg_save (label, PC_REGNUM, offset += 4);
 
-      dwarf2out_reg_save (label, PC_REGNUM, offset -= 4);
-      dwarf2out_reg_save (label, FRAME_POINTER_REGNUM, offset -= 4);
-      dwarf2out_reg_save (label, ARG_POINTER_REGNUM, offset -= 4);
-      dwarf2out_def_cfa (label, FRAME_POINTER_REGNUM, -(offset - 4));
+      for (regno = 0; regno < FIRST_PSEUDO_REGISTER; ++regno)
+        if (regs_ever_live[regno] && !call_used_regs[regno])
+          dwarf2out_reg_save (label, regno, offset += 4);
     }
 
   size -= STARTING_FRAME_OFFSET;
diff -r 8787e2e577b3 -r cbd7042f2212 gnu/dist/gcc4/gcc/config/vax/vax.h
--- a/gnu/dist/gcc4/gcc/config/vax/vax.h        Tue Mar 18 23:43:38 2014 +0000
+++ b/gnu/dist/gcc4/gcc/config/vax/vax.h        Tue Mar 18 23:43:40 2014 +0000
@@ -166,6 +166,9 @@
 /* Specify the registers used for certain standard purposes.
    The values of these macros are register numbers.  */
 
+/* VAX PSW for DWARF-2 */
+#define PSW_REGNUM VAX_PSW_REGNUM
+
 /* VAX pc is overloaded on a register.  */
 #define PC_REGNUM VAX_PC_REGNUM
 
diff -r 8787e2e577b3 -r cbd7042f2212 gnu/dist/gcc4/gcc/config/vax/vax.md
--- a/gnu/dist/gcc4/gcc/config/vax/vax.md       Tue Mar 18 23:43:38 2014 +0000
+++ b/gnu/dist/gcc4/gcc/config/vax/vax.md       Tue Mar 18 23:43:40 2014 +0000
@@ -40,6 +40,7 @@
    (VAX_FP_REGNUM 13)      ; Register 13 contains the frame pointer
    (VAX_SP_REGNUM 14)      ; Register 14 contains the stack pointer
    (VAX_PC_REGNUM 15)      ; Register 15 contains the program counter
+   (VAX_PSW_REGNUM 16)     ; Program Status Word
   ]
 )
 



Home | Main Index | Thread Index | Old Index