From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Gc0qL-0007U9-3r for qemu-devel@nongnu.org; Mon, 23 Oct 2006 10:31:57 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Gc0qJ-0007Tg-Hg for qemu-devel@nongnu.org; Mon, 23 Oct 2006 10:31:56 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gc0qJ-0007Td-Bu for qemu-devel@nongnu.org; Mon, 23 Oct 2006 10:31:55 -0400 Received: from [65.74.133.4] (helo=mail.codesourcery.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1Gc0qJ-0001IR-75 for qemu-devel@nongnu.org; Mon, 23 Oct 2006 10:31:55 -0400 From: Paul Brook Subject: Re: [Qemu-devel] qemu vs gcc4 Date: Mon, 23 Oct 2006 15:31:50 +0100 References: <45391B22.1050608@palmsource.com> <200610231510.47140.paul@codesourcery.com> <453CD1A3.2060206@qumranet.com> In-Reply-To: <453CD1A3.2060206@qumranet.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200610231531.51496.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org > > We already do that. It doesn't stop gcc putting the return in the middle > > of the function. > > > > Paul > > void f1(); > void f2(); > > void f(int *z, int x, int y) > { > if (x) { > *z = x; > f1(); > } else { > *z = y; > f2(); > } > asm volatile (""); > } > > works, with gcc -O2 -fno-reorder-blocks. removing either the asm or the > -f flag doesn't. No idea if it's consistent across architectures. It doesn't work reliably though. We already do everything you mention above. Paul