[Patch, xtensa] Add LOCAL_REGNO to the xtensa backend.

Felix Yang fei.yang0953@gmail.com
Tue Jan 14 15:14:00 GMT 2014


Hi Sterling,

    The xtensa backend uses register windows, and we need to define
LOCAL_REGNO for it.
    The dataflow may not be accurate with this macro. This patch
passed the cases in testsuite/gcc.c-torture/execute dir.
    Please apply it if OK for trunk. Thanks.

Index: gcc/ChangeLog
===================================================================
--- gcc/ChangeLog    (revision 206599)
+++ gcc/ChangeLog    (working copy)
@@ -1,3 +1,7 @@
+2014-01-14  Felix Yang  <fei.yang0953@gmail.com>
+
+    * config/xtensa/xtensa.h (LOCAL_REGNO): New.
+
 2014-01-14  Richard Biener  <rguenther@suse.de>

     PR tree-optimization/58921
Index: gcc/config/xtensa/xtensa.h
===================================================================
--- gcc/config/xtensa/xtensa.h    (revision 206599)
+++ gcc/config/xtensa/xtensa.h    (working copy)
@@ -369,7 +369,14 @@ extern char xtensa_hard_regno_mode_ok[][FIRST_PSEU
     ((unsigned) ((IN) - GP_REG_FIRST) < WINDOW_SIZE)) ?            \
    (IN) + WINDOW_SIZE : (IN))

+/* Define this macro if the target machine has register windows.  This
+   C expression returns true if the register is call-saved but is in the
+   register window.  */

+#define LOCAL_REGNO(REGNO)                        \
+  (GP_REG_P (REGNO) && ((unsigned) (REGNO - GP_REG_FIRST) < WINDOW_SIZE))
+
+
 /* Define the classes of registers for register constraints in the
    machine description.  */
 enum reg_class



Cheers,
Felix



More information about the Gcc-patches mailing list