diff mbox series

AIX unwind register number fixes

Message ID CAGWvnykuuMbZ4gYTEbci9-QbfE7vHa_f01usncvuzSyXJvnRRA@mail.gmail.com
State New
Headers show
Series AIX unwind register number fixes | expand

Commit Message

David Edelsohn June 5, 2019, 2:39 p.m. UTC
The recent changes to rs6000 "debug" register numbers created a
conflict in libgcc aix unwind support.  aix-unwind.h provided
definitions of the DWARF register numbers for its own reference.
After the internal register number changes and the definition of those
register names in rs6000.md, the register names appear in
insn-constants.h, which is included by libgcc.  The macro definitions
in aix-unwind.h now conflict with the versions derived from rs6000.md.

This patch changes the aix-unwind.h macro names from XX_REGNO to R_XX,
following the convention of the other unwind files in libgcc to avoid
conflict.

Bootstrapped on powerpc-ibm-aix7.2.0.0.

Thanks, David

* config/rs6000/aix-unwind.h (LR_REGNO): Rename to R_LR.
(CR2_REGNO): Rename to R_CR2.
(XER_REGNO): Rename to R_XER.
(FIRST_ALTIVEC_REGNO): Rename to R_FIRST_ALTIVEC.
(VRSAVE_REGNO): Rename to R_VRSAVE.
(VSCR_REGNO): R_VSCR.

       }
\
@@ -56,7 +56,7 @@
       {
\
        unsigned int *insn                                              \
          = (unsigned int *)                                            \
-           _Unwind_GetGR ((CTX), LR_REGNO);                            \
+           _Unwind_GetGR ((CTX), R_LR);                                \
        if (*insn == 0x80410014)                                        \
          _Unwind_SetGRPtr ((CTX), 2, (CTX)->cfa + 20);                 \
       }                                                                \
@@ -241,9 +241,9 @@ ppc_aix_fallback_frame_state (struct _Unwind_Conte
     if (i != __LIBGCC_STACK_POINTER_REGNUM__)
       REGISTER_CFA_OFFSET_FOR (fs, i, &mctx->gpr[i], new_cfa);

-  REGISTER_CFA_OFFSET_FOR (fs, CR2_REGNO, &mctx->cr, new_cfa);
-  REGISTER_CFA_OFFSET_FOR (fs, XER_REGNO, &mctx->xer, new_cfa);
-  REGISTER_CFA_OFFSET_FOR (fs, LR_REGNO, &mctx->lr, new_cfa);
+  REGISTER_CFA_OFFSET_FOR (fs, R_CR2, &mctx->cr, new_cfa);
+  REGISTER_CFA_OFFSET_FOR (fs, R_XER, &mctx->xer, new_cfa);
+  REGISTER_CFA_OFFSET_FOR (fs, R_LR, &mctx->lr, new_cfa);

   fs->retaddr_column = RETURN_COLUMN;
   REGISTER_CFA_OFFSET_FOR (fs, RETURN_COLUMN, &mctx->iar, new_cfa);
@@ -268,10 +268,10 @@ ppc_aix_fallback_frame_state (struct _Unwind_Conte

          for (i = 0; i < 32; i++)
            REGISTER_CFA_OFFSET_FOR
-           (fs, i+FIRST_ALTIVEC_REGNO, &vstate->regs[i], new_cfa);
+           (fs, i+R_FIRST_ALTIVEC, &vstate->regs[i], new_cfa);

-         REGISTER_CFA_OFFSET_FOR (fs, VSCR_REGNO, &vstate->vscr, new_cfa);
-         REGISTER_CFA_OFFSET_FOR (fs, VRSAVE_REGNO, &vstate->vrsave, new_cfa);
+         REGISTER_CFA_OFFSET_FOR (fs, R_VSCR, &vstate->vscr, new_cfa);
+         REGISTER_CFA_OFFSET_FOR (fs, R_VRSAVE, &vstate->vrsave, new_cfa);
        }
     }
diff mbox series

Patch

Index: aix-unwind.h
===================================================================
--- aix-unwind.h        (revision 271883)
+++ aix-unwind.h        (working copy)
@@ -24,12 +24,12 @@ 

 /* Useful register numbers.  */

-#define LR_REGNO             65
-#define CR2_REGNO            70
-#define XER_REGNO            76
-#define FIRST_ALTIVEC_REGNO  77
-#define VRSAVE_REGNO        109
-#define VSCR_REGNO          110
+#define R_LR             65
+#define R_CR2            70
+#define R_XER            76
+#define R_FIRST_ALTIVEC  77
+#define R_VRSAVE        109
+#define R_VSCR          110

 /* If the current unwind info (FS) does not contain explicit info
    saving R2, then we have to do a minor amount of code reading to
@@ -44,7 +44,7 @@ 
       {
\
        unsigned int *insn                                              \
          = (unsigned int *)                                            \
-           _Unwind_GetGR ((CTX), LR_REGNO);                            \
+           _Unwind_GetGR ((CTX), R_LR);                                \
        if (*insn == 0xE8410028)                                        \
          _Unwind_SetGRPtr ((CTX), 2, (CTX)->cfa + 40);                 \