From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6452 invoked by alias); 13 Oct 2011 12:18:03 -0000 Received: (qmail 6410 invoked by uid 22791); 13 Oct 2011 12:18:01 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 13 Oct 2011 12:17:33 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p9DCHWvF013715 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 13 Oct 2011 08:17:32 -0400 Received: from zebedee.pink (ovpn-113-55.phx2.redhat.com [10.3.113.55]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p9DCHV2i031478; Thu, 13 Oct 2011 08:17:32 -0400 Message-ID: <4E96D6DB.3040705@redhat.com> Date: Thu, 13 Oct 2011 12:18:00 -0000 From: Andrew Haley User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110928 Fedora/3.1.15-1.fc14 Thunderbird/3.1.15 MIME-Version: 1.0 To: gcc-help@gcc.gnu.org Subject: Re: gcc optimises out test of value in register-only loop References: <4E96CD98.5070704@redhat.com> <4E96D2ED.2010106@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2011-10/txt/msg00094.txt.bz2 On 10/13/2011 01:14 PM, MikeW wrote: > > I would certainly like there to be some way to ensure that an > expression in a loop gets (re) evaluated, in a 'volatile' context. For this, or something else? We already know that solving this particular problem only involves replacing a register variable declaration with a trivial asm that reads from the register. Andrew.