From patchwork Wed Sep 7 16:42:33 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georg-Johann Lay X-Patchwork-Id: 113795 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 9518EB6F70 for ; Thu, 8 Sep 2011 02:43:10 +1000 (EST) Received: (qmail 20076 invoked by alias); 7 Sep 2011 16:43:08 -0000 Received: (qmail 20067 invoked by uid 22791); 7 Sep 2011 16:43:07 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mo-p00-ob.rzone.de (HELO mo-p00-ob.rzone.de) (81.169.146.160) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 07 Sep 2011 16:42:53 +0000 X-RZG-AUTH: :LXoWVUeid/7A29J/hMvvT2k715jHQaJercGObUOFkj18odoYNahU4Q== X-RZG-CLASS-ID: mo00 Received: from [192.168.0.22] (business-188-111-022-002.static.arcor-ip.net [188.111.22.2]) by smtp.strato.de (fruni mo60) (RZmta 26.6) with ESMTPA id x00e39n87G8i1n ; Wed, 7 Sep 2011 18:42:33 +0200 (MEST) Message-ID: <4E679EF9.8000701@gjlay.de> Date: Wed, 07 Sep 2011 18:42:33 +0200 From: Georg-Johann Lay User-Agent: Thunderbird 2.0.0.24 (X11/20100302) MIME-Version: 1.0 To: gcc-patches@gcc.gnu.org CC: Richard Guenther Subject: [testsuite]: Fix gcc.c-torture/execute/pr48571-1.c (4 -> sizeof(int)) 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 This patch fixes magic number 4 and uses sizeof(int) instead so that the test no more fails on int=16 platforms. Successfully tested on AVR. Johann * gcc.c-torture/execute/pr48571-1.c (bar): Use offsets sizeof(int) instead of 4. Index: gcc.c-torture/execute/pr48571-1.c =================================================================== --- gcc.c-torture/execute/pr48571-1.c (revision 178527) +++ gcc.c-torture/execute/pr48571-1.c (working copy) @@ -1,3 +1,5 @@ +#define S (sizeof (int)) + unsigned int c[624]; void __attribute__((noinline)) bar (void) @@ -5,9 +7,9 @@ bar (void) unsigned int i; /* Obfuscated c[i] = c[i-1] * 2. */ for (i = 1; i < 624; ++i) - *(unsigned int *)((void *)c + (__SIZE_TYPE__)i * 4) + *(unsigned int *)((void *)c + (__SIZE_TYPE__)i * S) = 2 * *(unsigned int *)((void *)c + ((__SIZE_TYPE__)i + - ((__SIZE_TYPE__)-4)/4) * 4); + ((__SIZE_TYPE__)-S)/S) * S); } extern void abort (void); int