From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24669 invoked by alias); 20 Jul 2011 07:48:19 -0000 Received: (qmail 24652 invoked by uid 22791); 20 Jul 2011 07:48:18 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-yw0-f47.google.com (HELO mail-yw0-f47.google.com) (209.85.213.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 20 Jul 2011 07:47:44 +0000 Received: by ywa12 with SMTP id 12so2403810ywa.20 for ; Wed, 20 Jul 2011 00:47:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.150.150.38 with SMTP id x38mr8261082ybd.45.1311148063611; Wed, 20 Jul 2011 00:47:43 -0700 (PDT) Received: by 10.150.205.2 with HTTP; Wed, 20 Jul 2011 00:47:43 -0700 (PDT) In-Reply-To: <201107191820.p6JIKC81025424@d06av02.portsmouth.uk.ibm.com> References: <20110630133955.GB13681@virgil.arch.suse.de> <201107191820.p6JIKC81025424@d06av02.portsmouth.uk.ibm.com> Date: Wed, 20 Jul 2011 08:33:00 -0000 Message-ID: Subject: Re: [PATCH, PR 49094] Refrain from creating misaligned accesses in SRA From: Richard Guenther To: Ulrich Weigand Cc: Martin Jambor , GCC Patches , rguenther@suse.de Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes 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/msg01586.txt.bz2 On Tue, Jul 19, 2011 at 8:20 PM, Ulrich Weigand wrote: > Martin Jambor wrote: > >> I had to add a test that the analyzed expression is not an SSA name. >> This has been approved by Rchi on IRC yesterday. =A0Thus, I have >> committed the following as revision 175703 after successful run of c >> and c++ testsuite on sparc64 (and a bootstrap and test with another >> patch on x86_64-linux). >> >> Thanks, >> >> Martin >> >> >> 2011-06-30 =A0Martin Jambor =A0 >> >> =A0 =A0 =A0 PR tree-optimization/49094 >> =A0 =A0 =A0 * tree-sra.c (tree_non_mode_aligned_mem_p): New function. >> =A0 =A0 =A0 (build_accesses_from_assign): Use it. > > This causes a regression on spu-elf: > FAIL: gcc.dg/tree-ssa/forwprop-5.c scan-tree-dump-times optimized "disapp= ear" 0 > > The problem is that in this expression > =A0disappear =3D VIEW_CONVERT_EXPR(x_8); > the rhs is considered unaligned and blocks the SRA transformation. > > The check you added for SSA_NAMEs doesn't hit, because the SSA_NAME is > encapsulated in a VIEW_CONVERT_EXPR. =A0When get_object_alignment is call= ed, > the VIEW_CONVERT_EXPR is stripped off by get_inner_reference and the > SSA_NAME appears, but then get_object_alignment doesn't handle it > and just returns the default alignment of 8 bits. > > Maybe get_object_alignment should itself handle SSA_NAMEs? But what should it return for a rvalue? There is no "alignment" here. I t= hink SRA should avoid asking for rvalues. Richard. > Bye, > Ulrich > > -- > =A0Dr. Ulrich Weigand > =A0GNU Toolchain for Linux on System z and Cell BE > =A0Ulrich.Weigand@de.ibm.com >