From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6895 invoked by alias); 24 Jun 2008 15:58:00 -0000 Received: (qmail 6887 invoked by uid 22791); 24 Jun 2008 15:57:59 -0000 X-Spam-Check-By: sourceware.org Received: from nf-out-0910.google.com (HELO nf-out-0910.google.com) (64.233.182.191) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 24 Jun 2008 15:57:37 +0000 Received: by nf-out-0910.google.com with SMTP id c10so31953nfd.6 for ; Tue, 24 Jun 2008 08:57:34 -0700 (PDT) Received: by 10.210.80.2 with SMTP id d2mr384432ebb.7.1214323054085; Tue, 24 Jun 2008 08:57:34 -0700 (PDT) Received: by 10.150.152.8 with HTTP; Tue, 24 Jun 2008 08:57:34 -0700 (PDT) Message-ID: Date: Tue, 24 Jun 2008 16:15:00 -0000 From: "Gunnar Von Boehn" To: "Andreas Schwab" Subject: Re: Fix for GCC Bugzilla Bug 36133 Cc: gcc-patches@gcc.gnu.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2008-06/txt/msg01511.txt.bz2 Hi Andreas, What is your opinion to this topic now? Maybe I can summarize the question again. When I understood your question correctly then it was: "Does it make sense to mark the CC as invalid after a shift instruction." Your point was that a shift will "trash" the carry flag. If the CC is marked as valid GCC will but BCC instructions after the shift. If the CC is marked as invalid then GCC will put a TST before the BCC instruction to regenerate the conditions codes. As a matter of fact TST will always clear the carry flag. This means, that there can never be an BCC that depends on the carry flag after the TST instruction. There can of course only be BCC instructions after the TST that use condition flags that are actually set by TST (these are N and Z) The flags (N and Z ) are both correctly set ba the shift instruction as well. Ergo: The TST instruction is redundant and should not by generated by GCC. Ergo: The CC should be marked as valid after a shift or rotate instruction. Do you agree with me here? It would be good if we finally can fix this again. AFAIK GCC 2.9 did behave correctly in this matter. Cheers Gunnar The question basicly is does it make sense to makr the CC as invaklid "CC_STATUS_INIT" On Thu, Jun 19, 2008 at 2:43 PM, Gunnar Von Boehn wrote: > Hallo Andreas, > >> The carry flag is used by bhi/bls, which are generated by the gtu/ltu >> patterns. > > Can GCC create a BHI instructions that follows a LSR ? > Honestly, I fail to see the possibility for this in GCC. > > Doesn't the BCC created by GCC behave like a BCC after a TST against ZERO? > Isn't it true that such a BCC would never be a BHI but always a BNE or BEQ ? > > If you think its somehow possible to get GCC to create a BHI then > please be so kind > and help me to understand this and please give a C-example. > > Kind regards > Gunnar >