From patchwork Tue Oct 11 10:40:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Senthil Kumar Selvaraj X-Patchwork-Id: 680680 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3stYTM1GS1z9s5w for ; Tue, 11 Oct 2016 21:41:58 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=RGQYkNTX; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type; q=dns; s= default; b=WROpD7Zba2SKCZoO1Niz8g0qAnILthvtSHD878FL8QDXtYMKTtYv7 jpYR58EqNdXDrIQ/Oc5DPqo/NPNA9yUc4fGKRY1AEmYu2USuDJMJMt20LTh0AQ22 R9HeqaUTAzW/waEK15w+FpHFZR09/Nt2KkOjj9OgTo1jkGKgIUfkc0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type; s= default; bh=oZTOFcMBVUwyXn0WMKvSHBonCPg=; b=RGQYkNTXkla/2qyXIaWy z+yBz2fcjdzbYsxGEjFZXNC3W0ayHmLOJNNd0QtnSumSXKG6P9BTVYINuOUfU6Pq CuU59A5TYxXuCVLHAgzc4EnMpRl0pCm5iIYxmKZ4bp5aPlw7S1xXb+CLHKnGyyOt gE5EdKUPdxyhwBrI6a5fzVQ= Received: (qmail 54400 invoked by alias); 11 Oct 2016 10:41:51 -0000 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 Received: (qmail 53742 invoked by uid 89); 11 Oct 2016 10:41:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.5 required=5.0 tests=BAYES_50, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=D*atmel.com, senthil_kumar.selvaraj@atmel.com, senthil_kumarselvarajatmelcom, Senthil X-HELO: eusmtp01.atmel.com Received: from eusmtp01.atmel.com (HELO eusmtp01.atmel.com) (212.144.249.242) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 11 Oct 2016 10:41:40 +0000 Received: from HNOCHT02.corp.atmel.com (10.145.133.41) by eusmtp01.atmel.com (10.145.145.30) with Microsoft SMTP Server (TLS) id 14.3.235.1; Tue, 11 Oct 2016 12:41:35 +0200 Received: from jaguar.atmel.com (10.145.133.18) by HNOCHT02.corp.atmel.com (10.145.133.41) with Microsoft SMTP Server (TLS) id 14.3.235.1; Tue, 11 Oct 2016 12:41:36 +0200 User-agent: mu4e 0.9.17; emacs 24.5.1 From: Senthil Kumar Selvaraj To: Subject: [Patch, testsuite] Fix gcc.g/tree-ssa/pr59597.c failure for avr Date: Tue, 11 Oct 2016 16:10:26 +0530 Message-ID: <87vawz419h.fsf@atmel.com> MIME-Version: 1.0 X-IsSubscribed: yes Hi, This patch declares loop index variable j as a 32 bit int instead of assuming ints are 32 bits. The smaller int size on the avr makes prior passes optimize away the loop exit check (j < 10000000), as the constant is outside the range of a 16 bit int. Committed to trunk, after reg testing with avr and x86_64-pc-linux Regards Senthil gcc/testsuite/ChangeLog 2016-10-11 Senthil Kumar Selvaraj * gcc.dg/tree-ssa/pr59597.c: Typedef __INT32_TYPE__ to i32. (main): Declare j as i32 instead of int. Index: gcc/testsuite/gcc.dg/tree-ssa/pr59597.c =================================================================== --- gcc/testsuite/gcc.dg/tree-ssa/pr59597.c (revision 240974) +++ gcc/testsuite/gcc.dg/tree-ssa/pr59597.c (working copy) @@ -4,6 +4,8 @@ typedef unsigned short u16; typedef unsigned char u8; typedef unsigned int u32; +__extension__ typedef __INT32_TYPE__ i32; + long int random(int); #define NNN 10 @@ -37,7 +39,7 @@ int main (int argc, char argv[]) { - int i, j; u16 crc; + int i; i32 j; u16 crc; for (j = 0; j < 10000000; j++) { for (i = 0; i < NNN; i++)