From owner-freebsd-hackers Sat Mar 13 14:55:33 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from obie.softweyr.com (unknown [204.68.178.33]) by hub.freebsd.org (Postfix) with ESMTP id 8050C1547A for ; Sat, 13 Mar 1999 14:55:29 -0800 (PST) (envelope-from wes@softweyr.com) Received: from softweyr.com (wes@zaphod.softweyr.com [204.68.178.35]) by obie.softweyr.com (8.8.8/8.8.8) with ESMTP id PAA07767; Sat, 13 Mar 1999 15:55:07 -0700 (MST) (envelope-from wes@softweyr.com) Message-ID: <36EAECCA.42F5C549@softweyr.com> Date: Sat, 13 Mar 1999 15:55:06 -0700 From: Wes Peters Organization: Softweyr llc X-Mailer: Mozilla 4.5 [en] (X11; U; FreeBSD 3.1-RELEASE i386) X-Accept-Language: en MIME-Version: 1.0 To: Dennis Cc: hackers@FreeBSD.ORG Subject: Re: 'C' language question References: <199903132232.RAA19255@etinc.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Dennis wrote: > > I have a memory mapped controller that requires that all of its > register reads and writes be 32 bits....the follow code: > > *reg |= 0x80000000; > > generates a byte OR (ORB instruction) which trashes the register with > gcc 2.9.2....a stupid "optimization" that happens to be wrong in this > case. > > is there a declaration that will force the compiler to generate a 32bit > OR (ORL instruction) on this? No. Read the register into a word in memory (or a register in asm code), set/clear bits in the word, then write the word back. -- "Where am I, and what am I doing in this handbasket?" Wes Peters Softweyr LLC http://www.softweyr.com/~softweyr wes@softweyr.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message