From patchwork Wed Mar 21 10:24:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jambor X-Patchwork-Id: 147959 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id D1AFEB6F13 for ; Wed, 21 Mar 2012 21:24:43 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1332930285; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Date: From:To:Cc:Subject:Message-ID:Mail-Followup-To:References: MIME-Version:Content-Type:Content-Disposition:In-Reply-To: User-Agent:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=pesCMrT GZBQKSwbj8/QRBZALe+w=; b=DOWe1wKLGxiG0W5kRPT7Chsdhsl/iZyaJUFUTJY NDXwBhwDFm9wTotAzWxSFcOpIDlXwnyQwx6GKQi2PdLK8QKD7MlyrMF3SSts6pok CMyHshF4r0KCdQXkFvQaDs0GaxV3lirKeGwnkcDB8x4PxQCvf3J20IKKZxnaJdkL sAHo= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Date:From:To:Cc:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:User-Agent:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=ChV39ACkVcmFNLOUfNTgIRSyTYwu/Q7pXiqSY5KKiNPWqVR3IXgpqPdz42BEJX xKH8jjKIjnt3Dn7flPLlToHA3P6VwInJoa55mtfCfdBIZK1dAKxDEBUDRTIS/1F7 umQyAfnYKduMbc4kfLOCoSqJCnJOXBnZnUHkax1rEIBgQ=; Received: (qmail 6161 invoked by alias); 21 Mar 2012 10:24:39 -0000 Received: (qmail 6150 invoked by uid 22791); 21 Mar 2012 10:24:38 -0000 X-SWARE-Spam-Status: No, hits=-5.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 21 Mar 2012 10:24:24 +0000 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 87161932D7; Wed, 21 Mar 2012 11:24:23 +0100 (CET) Date: Wed, 21 Mar 2012 11:24:23 +0100 From: Martin Jambor To: Georg-Johann Lay Cc: GCC Patches Subject: Re: [RFC PATCH 0/3] Fixing expansion of misaligned MEM_REFs on strict-alignment targets Message-ID: <20120321102422.GB14860@virgil.arch.suse.de> Mail-Followup-To: Georg-Johann Lay , GCC Patches References: <20120228013036.494202900@virgil.suse.cz> <4F68D774.1000708@gjlay.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4F68D774.1000708@gjlay.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi, On Tue, Mar 20, 2012 at 08:16:04PM +0100, Georg-Johann Lay wrote: > Martin Jambor wrote: > > Hi, > > > > this is another iteration of my attempts to fix expansion of > > misaligned memory accesses on strict-alignment platforms (which was > > suggested by Richi in > > http://gcc.gnu.org/ml/gcc-patches/2011-08/msg00931.html and my first > > attempt was posted as > > http://gcc.gnu.org/ml/gcc-patches/2012-01/msg00319.html). > > > > This time I got further, to big extent thanks to parts of Richi's > > fixes of PR 50444 which cleaned up expr.c considerably. I have > > successfully bootstrapped the combined patch on x86_64-linux, > > i686-linux, ia64-linux (without Ada) and sparc64-linux (without Java). > > I have run the c and c++ testsuites on individual patches on sparc64 > > and ia64 too. > > > > Nevertheless, since I still lack experience in this area, there will > > almost certainly be comments and suggestions and therefore I have > > divided the three main changes to three different patches, so that > > they are easier to comment on by both me and anybody reviewing them. > > > > Thanks in advance for any comments, > > > > Martin > > Hi Martin. > > The new test cases make implications on the size of int: for example > they crash for targets with sizeof(int) == 2 > Crash? I assume the tests misaligned-expand-[12].c abort because of the comparison with 0xdeadbeef constant, misaligned-expand-3.c should not be affected by size of int. If that is the case, does the following patch fixes the issue for you? Sorry for the inconvenience, Martin 2012-03-21 Martin Jambor * gcc.dg/misaligned-expand-1.c (cst): Cast to int. * gcc.dg/misaligned-expand-2.c (cst): Likewise. Index: src/gcc/testsuite/gcc.dg/misaligned-expand-1.c =================================================================== --- src.orig/gcc/testsuite/gcc.dg/misaligned-expand-1.c +++ src/gcc/testsuite/gcc.dg/misaligned-expand-1.c @@ -14,7 +14,7 @@ foo (myint *p) return *p; } -#define cst 0xdeadbeef +#define cst (int) 0xdeadbeef #define NUM 8 struct blah Index: src/gcc/testsuite/gcc.dg/misaligned-expand-2.c =================================================================== --- src.orig/gcc/testsuite/gcc.dg/misaligned-expand-2.c +++ src/gcc/testsuite/gcc.dg/misaligned-expand-2.c @@ -14,7 +14,7 @@ foo (myint *p, unsigned int i) *p = i; } -#define cst 0xdeadbeef +#define cst (int) 0xdeadbeef #define NUM 8 struct blah @@ -25,8 +25,6 @@ struct blah struct blah g; -#define cst 0xdeadbeef - int main (int argc, char **argv) {