From patchwork Fri Oct 4 11:41:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 1171754 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-510230-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="mD1nAcUL"; 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 46l7Hm5ckdz9sPd for ; Fri, 4 Oct 2019 21:41:22 +1000 (AEST) 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=KCGoB5GTjKGWhjbW24YcHQV6Wdr2JEtBod2Ly4kLvbM7JRN/g96Ia Vj7Ki/BErffAuHnPS6TkLoggeCsqylEq388rfTXOg7NsHFHNgtOdkobEe0D7fRTn ymYJLy7Q3ey6GBomMiM6WYulc5Y7b2Gb3u90ofOl+LwACdZPXjzbwU= 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=ufFSiW2TDmW4POFXyMA54dpLm8A=; b=mD1nAcULGOEms5lPD7Fa 07zVTnVmk1/VNCIQt1lVfffCrj66Di0j+Ah4bHUpY5ob6VcqW7PpPLg9lldb7KId uE0axzqsXMMo8Ssc8zPeKClniu4+okvHjP20D0ubCsU4Zfjemsq7FcD6dtH1UI4I BYEUEwS27QlyfM7VfpBG6Qc= Received: (qmail 129944 invoked by alias); 4 Oct 2019 11:41:16 -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 129932 invoked by uid 89); 4 Oct 2019 11:41:15 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy=INT_MAX, int_max X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 04 Oct 2019 11:41:14 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 2F8C4AEE0 for ; Fri, 4 Oct 2019 11:41:12 +0000 (UTC) Date: Fri, 4 Oct 2019 13:41:12 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix gcc/testsuite/gcc.c-torture/execute/loop-3.c Message-ID: User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Which invokes undefined behavior. Committed as obvious. Richard. 2019-10-04 Richard Biener * gcc.c-torture/execute/loop-3.c: Fix undefined behavior. diff --git a/gcc/testsuite/gcc.c-torture/execute/loop-3.c b/gcc/testsuite/gcc.c-torture/execute/loop-3.c index e314a01b1f1..33eb18826fd 100644 --- a/gcc/testsuite/gcc.c-torture/execute/loop-3.c +++ b/gcc/testsuite/gcc.c-torture/execute/loop-3.c @@ -13,7 +13,7 @@ f (m) i = m; do { - g (i * INT_MAX / 2); + g ((int)((unsigned)i * INT_MAX) / 2); } while (--i > 0); }