From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2197 invoked by alias); 4 Oct 2011 16:30:44 -0000 Received: (qmail 2185 invoked by uid 22791); 4 Oct 2011 16:30:41 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 04 Oct 2011 16:30:16 +0000 Received: from wpaz13.hot.corp.google.com (wpaz13.hot.corp.google.com [172.24.198.77]) by smtp-out.google.com with ESMTP id p94GUF7M004991 for ; Tue, 4 Oct 2011 09:30:15 -0700 Received: from pzk1 (pzk1.prod.google.com [10.243.19.129]) by wpaz13.hot.corp.google.com with ESMTP id p94GUD5x018286 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Tue, 4 Oct 2011 09:30:14 -0700 Received: by pzk1 with SMTP id 1so1774219pzk.1 for ; Tue, 04 Oct 2011 09:30:12 -0700 (PDT) Received: by 10.68.16.65 with SMTP id e1mr11038956pbd.27.1317745812784; Tue, 04 Oct 2011 09:30:12 -0700 (PDT) Received: by 10.68.16.65 with SMTP id e1mr11038933pbd.27.1317745812643; Tue, 04 Oct 2011 09:30:12 -0700 (PDT) Received: from coign.google.com ([2620:0:1000:2304:21d:e0ff:fe06:c087]) by mx.google.com with ESMTPS id d7sm41214516pbn.8.2011.10.04.09.30.11 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 04 Oct 2011 09:30:12 -0700 (PDT) From: Ian Lance Taylor To: "Naveen H. S" Cc: "gcc-help\@gcc.gnu.org" Subject: Re: Problem with peephole optimizing the register References: <5CD0E437A05A514A90A1B12527F331540E4182@KCHJEXMB02.kpit.com> <5CD0E437A05A514A90A1B12527F33154176B9EAB@KCHJEXMB02.kpit.com> Date: Tue, 04 Oct 2011 16:30:00 -0000 In-Reply-To: <5CD0E437A05A514A90A1B12527F33154176B9EAB@KCHJEXMB02.kpit.com> (Naveen H. S.'s message of "Tue, 4 Oct 2011 14:07:45 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-System-Of-Record: true 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/msg00025.txt.bz2 "Naveen H. S" writes: > It can be noted that the value at Fdi(label ref) is copied into r7 > register. The r7 register is modified and the branch depends on r7. > However, with tbit peepholes; r7 register is optimized away. > > In an application, r7 register is being used as source in the > sequence after tbit instruction. The above snippet shows that > the r7 value is moved into r2. However, as the r2 value is optimized > away; wrong value is moved into r2 and hence application crashes. > The peep2_reg_dead_p, find_reg_note and other functions were tried > out without much use. Show us the RTL and the define_peephole2. >From what you have described so far peep2_reg_dead_p ought to work. Also, which version of gcc? Ian