From patchwork Thu Dec 14 15:07:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 848605 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-469208-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="jVyRWNpJ"; dkim-atps=neutral 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 3yyH4C7479z9sCZ for ; Fri, 15 Dec 2017 02:07:55 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=ULEG5iOVHeoedPS4R1xh6+7j+sjPGpUqz0ddOLp9/BLjZ+p5vNeKU u7NARbRguDUQ/Wt8APXGTGgEmAtsOR/xPUSMZlPGAEds9k6oD2xotUkS5SAcMFeG m4KMKmP2calseHEkkRer93/Ay+4fe3jEUXY/kq/VKd0qwTmkFq37So= 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:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=XxguxAPkFeYAe6ejfQ7tMipeY14=; b=jVyRWNpJUyfPtWq2Am4+ 0zmMeCz/y1ya2/qrgXnG14JhONdj1V0iUHdfv5luiUEJlr5cvT47D74D1oMopR5/ UeTrZNqUk9U0nYtvZ9q85I/YqPMydvaBYPej29W9kzsssKKNDiUoGhu8F/beDud9 fBEXdP1iB7qTxOXD1AcDRqE= Received: (qmail 12870 invoked by alias); 14 Dec 2017 15:07:47 -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 12129 invoked by uid 89); 14 Dec 2017 15:07:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.4 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=Hx-languages-length:721 X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 14 Dec 2017 15:07:40 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 33B3FADD5 for ; Thu, 14 Dec 2017 15:07:38 +0000 (UTC) Date: Thu, 14 Dec 2017 16:07:38 +0100 (CET) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] Testcase for fixed PR65258 Message-ID: User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 Committed. Richard. 2017-12-14 Richard Biener PR tree-optimization/65258 * gcc.dg/Warray-bounds-23.c: New testcase. Index: gcc/testsuite/gcc.dg/Warray-bounds-23.c =================================================================== --- gcc/testsuite/gcc.dg/Warray-bounds-23.c (nonexistent) +++ gcc/testsuite/gcc.dg/Warray-bounds-23.c (working copy) @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -Warray-bounds" } */ + +int main() +{ + unsigned i, j, a[10] = {0}; + + for (j = 23; j < 25; j++){ + for (i = j / 8; i --> 0;) a[i] = 0; /* { dg-bogus "array bounds" } */ + for (i = 1; i --> 0;) __builtin_printf("%u", a[i]); + } + + return 0; +} +