From patchwork Fri Aug 19 12:29:35 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 110586 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 D5F9BB6F65 for ; Fri, 19 Aug 2011 22:30:13 +1000 (EST) Received: (qmail 5216 invoked by alias); 19 Aug 2011 12:30:08 -0000 Received: (qmail 5184 invoked by uid 22791); 19 Aug 2011 12:30:05 -0000 X-SWARE-Spam-Status: No, hits=-3.8 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD 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; Fri, 19 Aug 2011 12:29:36 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 4BB1C8CC2B for ; Fri, 19 Aug 2011 14:29:35 +0200 (CEST) Date: Fri, 19 Aug 2011 14:29:35 +0200 (CEST) From: Richard Guenther To: gcc-patches@gcc.gnu.org Subject: [PATCH] Some data-dep testcases Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 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 While working on PR50067, with some local changes I made them fail. Tested on x86_64-unknown-linux-gnu, applied. Richard. 2011-08-19 Richard Guenther * gcc.dg/torture/pr50067-1.c: New testcase. * gcc.dg/torture/pr50067-2.c: Likewise. Index: testsuite/gcc.dg/torture/pr50067-1.c =================================================================== --- testsuite/gcc.dg/torture/pr50067-1.c (revision 0) +++ testsuite/gcc.dg/torture/pr50067-1.c (revision 0) @@ -0,0 +1,18 @@ +/* { dg-do run } */ + +/* Make sure data-dependence analysis does not compute a bogus + distance vector for the different sized accesses. */ + +extern int memcmp(const void *, const void *, __SIZE_TYPE__); +extern void abort (void); +short a[32] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 }; +short b[32] = { 4, 0, 5, 0, 6, 0, 7, 0, 8, 0, }; +int main() +{ + int i; + for (i = 0; i < 32; ++i) + (*((unsigned short(*)[32])&a[0]))[i] = (*((char(*)[32])&a[0]))[i+8]; + if (memcmp (&a, &b, sizeof (a)) != 0) + abort (); + return 0; +} Index: testsuite/gcc.dg/torture/pr50067-2.c =================================================================== --- testsuite/gcc.dg/torture/pr50067-2.c (revision 0) +++ testsuite/gcc.dg/torture/pr50067-2.c (revision 0) @@ -0,0 +1,20 @@ +/* { dg-do run } */ + +/* Make sure data-dependence analysis does not compute a bogus + distance vector for the different sized accesses. */ + +extern int memcmp(const void *, const void *, __SIZE_TYPE__); +extern void abort (void); +short a[32] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 }; +short b[32] = { 4, 0, 5, 0, 6, 0, 7, 0, 8, 0, }; +int main() +{ + int i; + for (i = 0; i < 32; ++i) + { + a[i] = (*((char(*)[32])&a[0]))[i+8]; + } + if (memcmp (&a, &b, sizeof (a)) != 0) + abort (); + return 0; +}