Subject: Re: gcc4 status
To: None <mouse@Rodents.Montreal.QC.CA>
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
List: tech-toolchain
Date: 05/25/2006 01:57:45
mouse@Rodents.Montreal.QC.CA wrote:

> I don't know about the rest of it, but it seems to me that this has
> order-of-evaluation problems: it evaluates its arguments *after*
> performing the write barrier, not *before*.  (This usually won't
> matter, but if one of the arguments is, for example, a function call
> that does a significant amount of work, it may.)

Hmm. Someone may have bus_space_barrier(t,h,bus_space_read_1(t,h,o),l,f)?

Anyway, the following patch seems to work too.
(though I'm not sure why gcc4 complains about the original one)
---
Izumi Tsutsui

Index: bus.h
===================================================================
RCS file: /cvsroot/src/sys/arch/cobalt/include/bus.h,v
retrieving revision 1.18
diff -u -r1.18 bus.h
--- bus.h	18 May 2006 15:37:05 -0000	1.18
+++ bus.h	24 May 2006 16:55:35 -0000
@@ -532,8 +532,8 @@
  * On the MIPS, we just flush the write buffer.
  */
 #define	bus_space_barrier(t, h, o, l, f)	\
-	((void)((void)(t), (void)(h), (void)(o), (void)(l), (void)(f)),	\
-	 wbflush())
+	((void)((void)(t), (void)(h), (void)(o), (void)(l), (void)(f),	\
+	 wbflush()))
 #define	BUS_SPACE_BARRIER_READ	0x01		/* force read barrier */
 #define	BUS_SPACE_BARRIER_WRITE	0x02		/* force write barrier */