From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25637 invoked by alias); 11 Aug 2011 12:22:43 -0000 Received: (qmail 25622 invoked by uid 22791); 11 Aug 2011 12:22:41 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-gx0-f175.google.com (HELO mail-gx0-f175.google.com) (209.85.161.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 11 Aug 2011 12:22:17 +0000 Received: by gxk3 with SMTP id 3so97864gxk.20 for ; Thu, 11 Aug 2011 05:22:16 -0700 (PDT) Received: by 10.236.76.135 with SMTP id b7mr9038210yhe.56.1313065336099; Thu, 11 Aug 2011 05:22:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.147.41.16 with HTTP; Thu, 11 Aug 2011 05:21:36 -0700 (PDT) In-Reply-To: <4E431BD8.8060705@redhat.com> References: <4E431BD8.8060705@redhat.com> From: "Paulo J. Matos" Date: Thu, 11 Aug 2011 12:22:00 -0000 Message-ID: Subject: Re: Move insn out of the way To: Vladimir Makarov Cc: gcc@gcc.gnu.org, Richard Guenther Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes 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: 2011-08/txt/msg00216.txt.bz2 On Thu, Aug 11, 2011 at 1:01 AM, Vladimir Makarov wro= te: > I can not reproduce the problem.=C2=A0 It would be nice to give all info = (the > code without includes and all options).=C2=A0 In this case I could have m= ore info > to say more definitely about the reason of the problem in IRA. > Let me add another example using the avr backend that produces really strange code. The code has a similar nature: _Bool simple(unsigned long *a, unsigned long *b) { return *a =3D=3D *b; } Generates the following assembler when compiled with -Os in gcc-4.6: simple: push r16 push r17 /* prologue: function */ /* frame size =3D 0 */ /* stack size =3D 2 */ .L__stack_usage =3D 2 mov r30,r24 mov r31,r25 ldi r24,lo8(1) ld r16,Z ldd r17,Z+1 ldd r18,Z+2 ldd r19,Z+3 mov r30,r22 mov r31,r23 ld r20,Z ldd r21,Z+1 ldd r22,Z+2 ldd r23,Z+3 cp r16,r20 cpc r17,r21 cpc r18,r22 cpc r19,r23 breq .L2 ldi r24,lo8(0) .L2: /* epilogue start */ pop r17 pop r16 ret Again here the placing of the return value is not very relevant because I guess there's not much register pressure but when there is, in my arch, the resulting code is increased by 5 words simply due to the position of the constant assignment. In the above case, the constant assignment is the 5th instruction, when it could be pretty much closer to the end. I am interested in knowing if this is indeed an IRA problem and I have to wait for a fix, or if there's something that I need doing in the backend to tell GCC to delay the constant assignment. Cheers, --=20 PMatos