Unfortunately, my previous patch that included a change to gcc/config/vax/vax.h 
that increased FIRST_PSEUDO_REGISTER from 16 to 17 breaks the C++ exception 
handling that I’d worked so hard to get right with the rest of the patch. I 
believe I need to define DWARF_FRAME_REGISTERS to 16 in the same file to fix 
the size of the array that libgcc/unwind-dw2.c creates. The i386 backend and 
several others also define it their .h file for the same reason (compatibility 
with hardcoded frame offsets).

Here’s the first part of the patch to vax.h that increases 
FIRST_PSEUDO_REGISTER and also adds a definition of DWARF_FRAME_REGISTERS as 
16, with suitable comment. I’m testing it now. I know that C++ exceptions were 
working before I increased FIRST_PSEUDO_REGISTER to 17.

Regards,
Jake

Index: external/gpl3/gcc.old/dist/gcc/config/vax/vax.h
===================================================================
RCS file: /cvsroot/src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.h,v
retrieving revision 1.3
diff -u -r1.3 vax.h
--- external/gpl3/gcc.old/dist/gcc/config/vax/vax.h     23 Sep 2015 03:39:18 
-0000      1.3
+++ external/gpl3/gcc.old/dist/gcc/config/vax/vax.h     26 Mar 2016 14:34:29 
-0000
@@ -119,13 +119,17 @@
    The hardware registers are assigned numbers for the compiler
    from 0 to just below FIRST_PSEUDO_REGISTER.
    All registers that the compiler knows about must be given numbers,
-   even those that are not normally considered general registers.  */
-#define FIRST_PSEUDO_REGISTER 16
+   even those that are not normally considered general registers.
+   This includes PSW, which the VAX backend did not originally include.  */
+#define FIRST_PSEUDO_REGISTER 17
+
+/* For compatibility, DWARF_FRAME_REGISTERS must still be 16.  */
+#define DWARF_FRAME_REGISTERS 16
 
 /* 1 for registers that have pervasive standard uses
    and are not available for the register allocator.
-   On the VAX, these are the AP, FP, SP and PC.  */
-#define FIXED_REGISTERS {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1}
+   On the VAX, these are the AP, FP, SP, PC, and PSW.  */
+#define FIXED_REGISTERS {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1}
 
 /* 1 for registers not available across function calls.
    These must include the FIXED_REGISTERS and also any

Reply via email to