From patchwork Sun Dec 3 18:32:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 81233 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2397638582B0 for ; Sun, 3 Dec 2023 18:32:30 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 1BEC73858425 for ; Sun, 3 Dec 2023 18:32:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1BEC73858425 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1BEC73858425 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701628334; cv=none; b=Tm2g1royMdthNO0B7gpONwQhMHuLVop5MwfCyRNSVeIv6SBehE+IrEvS8bnyUFSvXKw0Hia0asWywc+tuUOdUVWOvxVh5S18DvL+Xuh0PWhKrcmKfqfRwOQW1Kv5ITQmDBlFZT3mxJk6AapYvEq8VW1A2L3t3AwbMgSk2txHwR0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701628334; c=relaxed/simple; bh=0ONELqjNMClUt8vCpT9fir7VkZCVoFIO7t0IpI646XI=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=MRjkCLjik8dK9N7XX4eTHgIsjF9Z5KUnHU67wJkcYt/LTdEo1C2u//Gbla7Ev9jnTm7dojlrF7tirBDC3VThNGcwgNIBnZkFyVOTRMPrizfbpc+wTdE4+B2AdGgI0H2/8/HFPDkV6R7N5ncKofINJW5/4UYCaGvJTAh+lVUTfSo= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701628330; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=U55ijGtv2TIx9ByEwvJkCoJYKM4iS/eb8eiJ0uVietM=; b=NkbkNbiwtM7WcS9G/2abB3+geidA0hvI80H75MzAKJ5tCJjV1fsp+Ct6dDK4LeS15arXxE Kjn6Ov82AYeINPk/BxlsW10l+/at6bXehS9QvWwc3DEINlVIMRF2d5O6pX20xokbdkopTu 8c33ydGBhv8ccu37wrGBOfvw6JUJDok= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-635-b4_VZ4pjNI2Ibk2AJkpO7g-1; Sun, 03 Dec 2023 13:32:07 -0500 X-MC-Unique: b4_VZ4pjNI2Ibk2AJkpO7g-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0DC7A85A58A; Sun, 3 Dec 2023 18:32:07 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.195.157]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BEE0A10E46; Sun, 3 Dec 2023 18:32:06 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 3B3IW30p3655659 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Sun, 3 Dec 2023 19:32:04 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 3B3IW2Aq3655658; Sun, 3 Dec 2023 19:32:02 +0100 Date: Sun, 3 Dec 2023 19:32:02 +0100 From: Jakub Jelinek To: Richard Biener , Robin Dapp , fweimer@tucnak.zalov.cz Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] testsuite: Fix up gcc.target/aarch64/pr112406.c for modern C [PR112406] Message-ID: References: <0424a09b-6867-4be9-8207-9d92a6187191@gmail.com> <5208e31f-f721-4df9-81b9-508a2e76accd@gmail.com> MIME-Version: 1.0 In-Reply-To: <5208e31f-f721-4df9-81b9-508a2e76accd@gmail.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Jakub Jelinek Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org On Fri, Nov 17, 2023 at 02:04:01PM +0100, Robin Dapp wrote: > > Yes, your version is also OK. > > The attached was bootstrapped and regtested on aarch64, x86 and > regtested on riscv. Going to commit it later unless somebody objects. Unfortunately the aarch64/pr112406.c was reduced too much and is rejected since the switch to modern C patchset. The following patch fixes that, I've verified the testcase before/after the changes still ICEs in r14-5563 and doesn't with r14-5564 and after the changes compiles fine with even latest trunk. Everything admittedly with a cross-compiler, but that shouldn't change anything. Ok for trunk? Note, one of the modern C changes is that at least when people use cvise/creduce/delta scripts which ensure no further errors are introduced during the reduction then expected originally such reductions will not appear anymore. 2023-12-03 Jakub Jelinek PR middle-end/112406 * gcc.target/aarch64/pr112406.c (MagickPixelPacket): Add missing semicolon. (GetImageChannelMoments_image): Avoid using implicit int. (SetMagickPixelPacket): Use void return type instead of implicit int. (GetImageChannelMoments): Likewise. Use __builtin_atan instead of atan. Jakub --- gcc/testsuite/gcc.target/aarch64/pr112406.c.jj 2023-11-18 09:35:20.944084686 +0100 +++ gcc/testsuite/gcc.target/aarch64/pr112406.c 2023-12-03 19:05:16.109365791 +0100 @@ -2,10 +2,10 @@ /* { dg-options "-march=armv8-a+sve -w -Ofast" } */ typedef struct { - int red + int red; } MagickPixelPacket; -GetImageChannelMoments_image, GetImageChannelMoments_image_0, +int GetImageChannelMoments_image, GetImageChannelMoments_image_0, GetImageChannelMoments___trans_tmp_1, GetImageChannelMoments_M11_0, GetImageChannelMoments_pixel_3, GetImageChannelMoments_y, GetImageChannelMoments_p; @@ -15,10 +15,12 @@ double GetImageChannelMoments_M00_0, Get MagickPixelPacket GetImageChannelMoments_pixel; +void SetMagickPixelPacket(int color, MagickPixelPacket *pixel) { pixel->red = color; } +void GetImageChannelMoments() { for (; GetImageChannelMoments_y; GetImageChannelMoments_y++) { SetMagickPixelPacket(GetImageChannelMoments_p, @@ -33,5 +35,5 @@ GetImageChannelMoments() { GetImageChannelMoments_M01_1 += GetImageChannelMoments_y * GetImageChannelMoments_p++; } - GetImageChannelMoments___trans_tmp_1 = atan(GetImageChannelMoments_M11_0); + GetImageChannelMoments___trans_tmp_1 = __builtin_atan(GetImageChannelMoments_M11_0); }