From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10907 invoked by alias); 8 Apr 2012 17:43:20 -0000 Received: (qmail 10898 invoked by uid 22791); 8 Apr 2012 17:43:19 -0000 X-SWARE-Spam-Status: No, hits=-4.1 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,MSGID_FROM_MTA_HEADER,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from e06smtp11.uk.ibm.com (HELO e06smtp11.uk.ibm.com) (195.75.94.107) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 08 Apr 2012 17:43:06 +0000 Received: from /spool/local by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 8 Apr 2012 18:43:04 +0100 Received: from d06nrmr1307.portsmouth.uk.ibm.com (9.149.38.129) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sun, 8 Apr 2012 18:43:02 +0100 Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1307.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q38Hh1XX2855010 for ; Sun, 8 Apr 2012 18:43:01 +0100 Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q38Hh1QY005254 for ; Sun, 8 Apr 2012 11:43:01 -0600 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with SMTP id q38Hh0Sq005251; Sun, 8 Apr 2012 11:43:00 -0600 Message-Id: <201204081743.q38Hh0Sq005251@d06av02.portsmouth.uk.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Sun, 08 Apr 2012 19:43:00 +0200 Subject: Re: i370 port To: mutazilah@gmail.com (Paul Edwards) Date: Sun, 08 Apr 2012 17:43:00 -0000 From: "Ulrich Weigand" Cc: gcc@gcc.gnu.org In-Reply-To: <628AD44D4A28409485757A69C7BC3663@PaulHP> from "Paul Edwards" at Apr 07, 2012 03:45:27 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit x-cbid: 12040817-5024-0000-0000-000002338930 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2012-04/txt/msg00248.txt.bz2 Hi Paul, > I put some debugging on here: > > op0 = XEXP (operands[0], 0); > if (GET_CODE (op0) == REG > || (GET_CODE (op0) == PLUS && GET_CODE (XEXP (op0, 0)) == REG > && GET_CODE (XEXP (op0, 1)) == CONST_INT > && (unsigned) INTVAL (XEXP (op0, 1)) < 4096)) > { > op0 = operands[0]; > fprintf(stderr, \"used as-is\n\"); > } > else > { > op0 = replace_equiv_address (operands[0], copy_to_mode_reg (SImode, > op0)); > fprintf(stderr, \"replaced\n\"); > } > > And I found out that op0 is already being "replaced". Shouldn't this > replacement eliminate the index register and just have a base > register, so that I don't need the hack further down? Well, sure, but this code is just the expander. If you check the RTL dumps, you'll notice that after the expand step, there will indeed be just a single base register. The problem is that RTL optimization steps *after* expand may modify the generated RTX. In particular reload will do so, and it will be guided by the constraints to tell it which modifications are allowed for this insn. If the actual insn pattern (not the expander) has a generic "m" constraint, reload will feel free to replace the address with any generally valid address pattern for the machine, including those that use an index registers, if it considers this replacement profitable. This is exactly the reason why you need a constraint letter that accepts only addresses without index register, instead of just using plain "m". Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com