From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7920 invoked by alias); 28 Jul 2011 07:29:16 -0000 Received: (qmail 7897 invoked by uid 22791); 28 Jul 2011 07:29:14 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_XF X-Spam-Check-By: sourceware.org Received: from mail-vx0-f175.google.com (HELO mail-vx0-f175.google.com) (209.85.220.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 28 Jul 2011 07:28:56 +0000 Received: by vxh2 with SMTP id 2so2008021vxh.20 for ; Thu, 28 Jul 2011 00:28:55 -0700 (PDT) Received: by 10.52.174.80 with SMTP id bq16mr749562vdc.190.1311838135824; Thu, 28 Jul 2011 00:28:55 -0700 (PDT) Received: from yakj.usersys.redhat.com (nat-pool-mxp-t.redhat.com [209.132.186.18]) by mx.google.com with ESMTPS id m9sm248679vcv.40.2011.07.28.00.28.53 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 28 Jul 2011 00:28:54 -0700 (PDT) Message-ID: <4E310FB3.40400@gnu.org> Date: Thu, 28 Jul 2011 07:59:00 -0000 From: Paolo Bonzini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20110707 Thunderbird/5.0 MIME-Version: 1.0 To: "H.J. Lu" CC: GCC Patches Subject: Re: PING: PATCH [4/n]: Prepare x32: Permute the conversion and addition if one operand is a constant References: <4E1AD86A.8000800@gnu.org> <4E1DC42D.1010307@gnu.org> <4E2D3E2B.5080602@gnu.org> <4E307432.80501@gnu.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 2011-07/txt/msg02490.txt.bz2 On 07/28/2011 12:59 AM, H.J. Lu wrote: > > Regarding correctness: you're converting a SImode operation to DImode by > > "pushing in" the zero_extend operation. What makes you think that base + > > constant offset won't overflow in any case? You have not answered this. > > And also: what are you gaining by allowing the wrap around? I don't need to > > know what ignore_address_wrap_around does, I need to know _why_ it is > > necessary. > > We have > > (zero_extend:DI (plus:SI (FOO:SI) (const_int Y))) > > I want to convert it to > > (plus:DI (zero_extend:DI (FOO:SI)) (const_int Y)) > > There is no zero-extend on (const_int Y). if FOO == 0xfffffffc and Y = 8, > > (zero_extend:DI (plus:SI (FOO:SI) (const_int Y))) > > gives 0x4 and > > (plus:DI (zero_extend:DI (FOO:SI)) (const_int Y)) > > gives 0x100000004. This was already clear upthread. I'm asking what it buys you in real code. > If (plus:SI (FOO:SI) (const_int Y)) won't overflow > or its behavior is implementation-defined, Behavior of plus:SI is never implementation defined, it is the extension that is done with an UNSPEC. (In fact I'm not even sure the optimization is ok when done with POINTER_EXTEND_UNSIGNED < 0, but I'm not touching that for now). Paolo