diff mbox

[1/5] Allow *_HARD_REG_SET arguments to be const

Message ID 87lhphnsu4.fsf@e105548-lin.cambridge.arm.com
State New
Headers show

Commit Message

Richard Sandiford Sept. 18, 2014, 10:09 a.m. UTC
Patch 4 needs to pass a const HARD_REG_SET to AND/COPY_HARD_REG_SET.
This patch allows that for all intent-in arguments.


gcc/
	* hard-reg-set.h (COPY_HARD_REG_SET, COMPL_HARD_REG_SET)
	(AND_HARD_REG_SET, AND_COMPL_HARD_REG_SET, IOR_HARD_REG_SET)
	(IOR_COMPL_HARD_REG_SET): Allow the "from" set to be constant.

Comments

Jeff Law Sept. 19, 2014, 6:14 a.m. UTC | #1
On 09/18/14 04:09, Richard Sandiford wrote:
> Patch 4 needs to pass a const HARD_REG_SET to AND/COPY_HARD_REG_SET.
> This patch allows that for all intent-in arguments.
>
>
> gcc/
> 	* hard-reg-set.h (COPY_HARD_REG_SET, COMPL_HARD_REG_SET)
> 	(AND_HARD_REG_SET, AND_COMPL_HARD_REG_SET, IOR_HARD_REG_SET)
> 	(IOR_COMPL_HARD_REG_SET): Allow the "from" set to be constant.
Seems like a good cleanup in and of itself.

Fine for the trunk independent of the other changes.

jeff
diff mbox

Patch

Index: gcc/hard-reg-set.h
===================================================================
--- gcc/hard-reg-set.h	2014-09-15 10:00:12.133398136 +0100
+++ gcc/hard-reg-set.h	2014-09-15 10:00:12.129398185 +0100
@@ -168,32 +168,38 @@  do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);
      scan_tp_[1] = -1; } while (0)
 
 #define COPY_HARD_REG_SET(TO, FROM)  \
-do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM);	\
+do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);			\
+     const HARD_REG_ELT_TYPE *scan_fp_ = (FROM);		\
      scan_tp_[0] = scan_fp_[0];					\
      scan_tp_[1] = scan_fp_[1]; } while (0)
 
 #define COMPL_HARD_REG_SET(TO, FROM)  \
-do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); 	\
+do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);			\
+     const HARD_REG_ELT_TYPE *scan_fp_ = (FROM);		\
      scan_tp_[0] = ~ scan_fp_[0];				\
      scan_tp_[1] = ~ scan_fp_[1]; } while (0)
 
 #define AND_HARD_REG_SET(TO, FROM)  \
-do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); 	\
+do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);			\
+     const HARD_REG_ELT_TYPE *scan_fp_ = (FROM);		\
      scan_tp_[0] &= scan_fp_[0];				\
      scan_tp_[1] &= scan_fp_[1]; } while (0)
 
 #define AND_COMPL_HARD_REG_SET(TO, FROM)  \
-do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); 	\
+do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);			\
+     const HARD_REG_ELT_TYPE *scan_fp_ = (FROM);		\
      scan_tp_[0] &= ~ scan_fp_[0];				\
      scan_tp_[1] &= ~ scan_fp_[1]; } while (0)
 
 #define IOR_HARD_REG_SET(TO, FROM)  \
-do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); 	\
+do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);			\
+     const HARD_REG_ELT_TYPE *scan_fp_ = (FROM);		\
      scan_tp_[0] |= scan_fp_[0];				\
      scan_tp_[1] |= scan_fp_[1]; } while (0)
 
 #define IOR_COMPL_HARD_REG_SET(TO, FROM)  \
-do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); 	\
+do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);			\
+     const HARD_REG_ELT_TYPE *scan_fp_ = (FROM);		\
      scan_tp_[0] |= ~ scan_fp_[0];				\
      scan_tp_[1] |= ~ scan_fp_[1]; } while (0)
 
@@ -236,37 +242,43 @@  do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);
      scan_tp_[2] = -1; } while (0)
 
 #define COPY_HARD_REG_SET(TO, FROM)  \
-do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM);	\
+do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);			\
+     const HARD_REG_ELT_TYPE *scan_fp_ = (FROM);		\
      scan_tp_[0] = scan_fp_[0];					\
      scan_tp_[1] = scan_fp_[1];					\
      scan_tp_[2] = scan_fp_[2]; } while (0)
 
 #define COMPL_HARD_REG_SET(TO, FROM)  \
-do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); 	\
+do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);			\
+     const HARD_REG_ELT_TYPE *scan_fp_ = (FROM);		\
      scan_tp_[0] = ~ scan_fp_[0];				\
      scan_tp_[1] = ~ scan_fp_[1];				\
      scan_tp_[2] = ~ scan_fp_[2]; } while (0)
 
 #define AND_HARD_REG_SET(TO, FROM)  \
-do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); 	\
+do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);			\
+     const HARD_REG_ELT_TYPE *scan_fp_ = (FROM);		\
      scan_tp_[0] &= scan_fp_[0];				\
      scan_tp_[1] &= scan_fp_[1];				\
      scan_tp_[2] &= scan_fp_[2]; } while (0)
 
 #define AND_COMPL_HARD_REG_SET(TO, FROM)  \
-do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); 	\
+do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);			\
+     const HARD_REG_ELT_TYPE *scan_fp_ = (FROM);		\
      scan_tp_[0] &= ~ scan_fp_[0];				\
      scan_tp_[1] &= ~ scan_fp_[1];				\
      scan_tp_[2] &= ~ scan_fp_[2]; } while (0)
 
 #define IOR_HARD_REG_SET(TO, FROM)  \
-do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); 	\
+do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);			\
+     const HARD_REG_ELT_TYPE *scan_fp_ = (FROM);		\
      scan_tp_[0] |= scan_fp_[0];				\
      scan_tp_[1] |= scan_fp_[1];				\
      scan_tp_[2] |= scan_fp_[2]; } while (0)
 
 #define IOR_COMPL_HARD_REG_SET(TO, FROM)  \
-do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); 	\
+do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);			\
+     const HARD_REG_ELT_TYPE *scan_fp_ = (FROM);		\
      scan_tp_[0] |= ~ scan_fp_[0];				\
      scan_tp_[1] |= ~ scan_fp_[1];				\
      scan_tp_[2] |= ~ scan_fp_[2]; } while (0)
@@ -316,42 +328,48 @@  do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);
      scan_tp_[3] = -1; } while (0)
 
 #define COPY_HARD_REG_SET(TO, FROM)  \
-do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM);	\
+do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);			\
+     const HARD_REG_ELT_TYPE *scan_fp_ = (FROM);		\
      scan_tp_[0] = scan_fp_[0];					\
      scan_tp_[1] = scan_fp_[1];					\
      scan_tp_[2] = scan_fp_[2];					\
      scan_tp_[3] = scan_fp_[3]; } while (0)
 
 #define COMPL_HARD_REG_SET(TO, FROM)  \
-do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); 	\
+do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);			\
+     const HARD_REG_ELT_TYPE *scan_fp_ = (FROM);		\
      scan_tp_[0] = ~ scan_fp_[0];				\
      scan_tp_[1] = ~ scan_fp_[1];				\
      scan_tp_[2] = ~ scan_fp_[2];				\
      scan_tp_[3] = ~ scan_fp_[3]; } while (0)
 
 #define AND_HARD_REG_SET(TO, FROM)  \
-do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); 	\
+do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);			\
+     const HARD_REG_ELT_TYPE *scan_fp_ = (FROM);		\
      scan_tp_[0] &= scan_fp_[0];				\
      scan_tp_[1] &= scan_fp_[1];				\
      scan_tp_[2] &= scan_fp_[2];				\
      scan_tp_[3] &= scan_fp_[3]; } while (0)
 
 #define AND_COMPL_HARD_REG_SET(TO, FROM)  \
-do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); 	\
+do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);			\
+     const HARD_REG_ELT_TYPE *scan_fp_ = (FROM);		\
      scan_tp_[0] &= ~ scan_fp_[0];				\
      scan_tp_[1] &= ~ scan_fp_[1];				\
      scan_tp_[2] &= ~ scan_fp_[2];				\
      scan_tp_[3] &= ~ scan_fp_[3]; } while (0)
 
 #define IOR_HARD_REG_SET(TO, FROM)  \
-do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); 	\
+do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);			\
+     const HARD_REG_ELT_TYPE *scan_fp_ = (FROM);		\
      scan_tp_[0] |= scan_fp_[0];				\
      scan_tp_[1] |= scan_fp_[1];				\
      scan_tp_[2] |= scan_fp_[2];				\
      scan_tp_[3] |= scan_fp_[3]; } while (0)
 
 #define IOR_COMPL_HARD_REG_SET(TO, FROM)  \
-do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); 	\
+do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);			\
+     const HARD_REG_ELT_TYPE *scan_fp_ = (FROM);		\
      scan_tp_[0] |= ~ scan_fp_[0];				\
      scan_tp_[1] |= ~ scan_fp_[1];				\
      scan_tp_[2] |= ~ scan_fp_[2];				\
@@ -402,37 +420,43 @@  do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);
        *scan_tp_++ = -1; } while (0)
 
 #define COPY_HARD_REG_SET(TO, FROM)  \
-do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); 	\
+do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);			\
+     const HARD_REG_ELT_TYPE *scan_fp_ = (FROM);		\
      int i;							\
      for (i = 0; i < HARD_REG_SET_LONGS; i++)			\
        *scan_tp_++ = *scan_fp_++; } while (0)
 
 #define COMPL_HARD_REG_SET(TO, FROM)  \
-do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); 	\
+do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);			\
+     const HARD_REG_ELT_TYPE *scan_fp_ = (FROM);		\
      int i;							\
      for (i = 0; i < HARD_REG_SET_LONGS; i++)			\
        *scan_tp_++ = ~ *scan_fp_++; } while (0)
 
 #define AND_HARD_REG_SET(TO, FROM)  \
-do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); 	\
+do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);			\
+     const HARD_REG_ELT_TYPE *scan_fp_ = (FROM);		\
      int i;							\
      for (i = 0; i < HARD_REG_SET_LONGS; i++)			\
        *scan_tp_++ &= *scan_fp_++; } while (0)
 
 #define AND_COMPL_HARD_REG_SET(TO, FROM)  \
-do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); 	\
+do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);			\
+     const HARD_REG_ELT_TYPE *scan_fp_ = (FROM);		\
      int i;							\
      for (i = 0; i < HARD_REG_SET_LONGS; i++)			\
        *scan_tp_++ &= ~ *scan_fp_++; } while (0)
 
 #define IOR_HARD_REG_SET(TO, FROM)  \
-do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); 	\
+do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);			\
+     const HARD_REG_ELT_TYPE *scan_fp_ = (FROM);		\
      int i;							\
      for (i = 0; i < HARD_REG_SET_LONGS; i++)			\
        *scan_tp_++ |= *scan_fp_++; } while (0)
 
 #define IOR_COMPL_HARD_REG_SET(TO, FROM)  \
-do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM); 	\
+do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);			\
+     const HARD_REG_ELT_TYPE *scan_fp_ = (FROM);		\
      int i;							\
      for (i = 0; i < HARD_REG_SET_LONGS; i++)			\
        *scan_tp_++ |= ~ *scan_fp_++; } while (0)