This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: global.c goofyness


On Nov  7, 1999, Jeffrey A Law <law@cygnus.com> wrote:

>   In message <19991107102659.E15921@cygnus.com>you write:
>> I _am_ looking at it, and I'm seeing that it _is_ compiling
>> _without_ the parens. 
> /puke/law/egcs/egcs/gcc/global.c:943: macro `EXECUTE_IF_SET_IN_ALLOCNO_SET' 
> used with too many (5) args
> /puke/law/egcs/egcs/gcc/global.c:1267: macro `EXECUTE_IF_SET_IN_ALLOCNO_SET' 
> used with too many (4) args

> PA target.

Would this patch fix it?

Index: gcc/ChangeLog
from  Alexandre Oliva  <oliva@lsd.ic.unicamp.br>
	
	* global.c (wrap_IOR_HARD_REG_SET): New function.
	(prune_preferences, find_reg): Use it.
	
Index: gcc/global.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/global.c,v
retrieving revision 1.45
diff -u -r1.45 global.c
--- gcc/global.c	1999/11/07 10:00:56	1.45
+++ gcc/global.c	1999/11/08 10:44:47
@@ -159,8 +159,22 @@
    mirror_conflicts has been run.  */
 #define EXECUTE_IF_CONFLICT(IN_ALLOCNO, OUT_ALLOCNO, CODE)\
   EXECUTE_IF_SET_IN_ALLOCNO_SET (conflicts + (IN_ALLOCNO) * allocno_row_words,\
-				 OUT_ALLOCNO, (CODE))
+				 (OUT_ALLOCNO), CODE)
 
+/* Wrapper for IOR_HARD_REG_SET that allows it to be called as a
+   single expression.  This is essential so that it can be used as an
+   argument for EXECUTE_IF_CONFLICT, otherwise some losing
+   preprocessors will get confused about the commas when expanding
+   EXECUTE_IF_SET_IN_ALLOCNO_SET.  */
+static inline void wrap_IOR_HARD_REG_SET PROTO((HARD_REG_SET *pto, HARD_REG_SET *pfrom));
+static inline void
+wrap_IOR_HARD_REG_SET (pto, pfrom)
+     HARD_REG_SET *pto;
+     HARD_REG_SET *pfrom;
+{
+  IOR_HARD_REG_SET (*pto, *pfrom);
+}
+
 /* Set of hard regs currently live (during scan of all insns).  */
 
 static HARD_REG_SET hard_regs_live;
@@ -936,9 +950,11 @@
 	  if (allocno_to_order[allocno2] > i)
 	    {
 	      if (allocno_size[allocno2] <= allocno_size[allocno])
-		IOR_HARD_REG_SET (temp, hard_reg_full_preferences[allocno2]);
+		(wrap_IOR_HARD_REG_SET (&temp,
+					&hard_reg_full_preferences[allocno2]));
 	      else
-		IOR_HARD_REG_SET (temp2, hard_reg_full_preferences[allocno2]);
+		(wrap_IOR_HARD_REG_SET (&temp2,
+					&hard_reg_full_preferences[allocno2]));
 	    }
 	});
 
@@ -1263,7 +1279,8 @@
       lim = allocno;
       EXECUTE_IF_CONFLICT (lim, j,
 	{
-	  IOR_HARD_REG_SET (hard_reg_conflicts[j], this_reg);
+	  (wrap_IOR_HARD_REG_SET (&hard_reg_conflicts[j],
+				  &this_reg));
 	});
     }
 }

-- 
Alexandre Oliva http://www.ic.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
oliva@{lsd.ic.unicamp.br,guarana.{org,com}} aoliva@{acm,computer}.org
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
** I may forward mail about projects to mailing lists; please use them

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]