This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Patch, xtensa] Add LOCAL_REGNO to the xtensa backend.
- From: Felix Yang <fei dot yang0953 at gmail dot com>
- To: Sterling Augustine <augustine dot sterling at gmail dot com>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 14 Jan 2014 23:14:18 +0800
- Subject: [Patch, xtensa] Add LOCAL_REGNO to the xtensa backend.
- Authentication-results: sourceware.org; auth=none
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