From patchwork Wed Jul 3 23:23:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thiago Jung Bauermann X-Patchwork-Id: 1956560 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=SO7ncFc+; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WDwpM1bNmz1xql for ; Thu, 4 Jul 2024 09:24:06 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BDC4D384A80B for ; Wed, 3 Jul 2024 23:24:04 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by sourceware.org (Postfix) with ESMTPS id E88723858403 for ; Wed, 3 Jul 2024 23:23:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E88723858403 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E88723858403 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::52e ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720049024; cv=none; b=mCVnTlL5DLXtKA+CHXg0x8i1uSq16ZFKBTTMQO0APNvJtiQcq6ps5g2rFuTU2ojwOX509ORmwRI0yvQJBl19I5E0ZKjfFCpx1K125eh541/pCPxX2sxaGPz2XspDMgBONtmOacP9xbjOHkuZyZ9hmPe1AUwwC6ZbDyAk/sYHolI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720049024; c=relaxed/simple; bh=yN8feGdc6Mq0ooaqXePNRjUOB3QsXokz4Xx4Gk0cZg8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=JE9ffks9DoWVNpZDK1hMQWrriDxISOLKnbayQj6odqGqWWJMCE/S3l0Ebq9WqLipTjfO01w5VTSmnqztKXDm1YJK7DSfr09wKVLZXh+5a2ZSzW7u0KyBwehfguDc4cubvnBW889h93K8VV0cCgnjaXIALwNySTmIz9jW5t4fxfk= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pg1-x52e.google.com with SMTP id 41be03b00d2f7-6e7e23b42c3so6183a12.1 for ; Wed, 03 Jul 2024 16:23:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720049021; x=1720653821; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=+ukaI8wCr4LuQzd+5S5qhAvkOJgjda590H0qSvCTK9M=; b=SO7ncFc+ifzfz3PxRQVA3xEdg4TEFNdO15oaaYaGu1nD69hzW96jEkYw0zPFrBzcZc 4CmZM95a179k6l8LTkIu7Z02ALIKxkeyz9atInrhQNFY0k44s6nnn7b0n26UrAHApg92 ugUFHqF9XhMSjVc0C1KKNZ1hXlGyOlyLWttxVfTdzT2iV9gZ1Y8y9j/IS6VsNq3ay/mg h7uTu0LWmPP1mEW8RWeA1MJPt28gl0k2Gk5ElhQ2Qz8OlVtJlKW6wHeQ7hXz0zss8Kx3 mU5d8ZWZ8jGJka3oIQ8SfUbGREeIMFdh/rgVMYS6zF4aA3yX2Wi/J9D6nn7pBcum1wF7 YArA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720049021; x=1720653821; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+ukaI8wCr4LuQzd+5S5qhAvkOJgjda590H0qSvCTK9M=; b=a6erzMUbob6MIcSU7QwiJBhUbkkGe6GVfKa1cZG7gu2q3prGK24G3eJazI6bOYebr1 eooHQ68V3hE19Yg4hqu42u0u32skFtoEQmN+MomSNlL/zHyZ43KMqI75/23Et6sCchzp 8UDY7p0E1waO3p/WwVevulZHhXDQM2iCoGg4qf6cXWxrk19Z++lOM5gvyimxpK6jreVa gTo63K4rpPNWJf8E0rjUyHiyuwh1HLIUoiluXBoAxDu0tewCJwZsKncq5dni7sE6BHag oI0TWy3KCkMdK2nxAssO1sJImSPlhs+/29n1klKnFAEndt/AwUNPSfRcQ5weCHnfMovu uq2A== X-Gm-Message-State: AOJu0Ywp1o/f7aaVrG/Re8dZo7vc8Sm/Lw1qYBjDtH+IuFsB3p/+mtwd l1ro1KUHswp55oUCzG5FxNkJgJHvewkqwWn2Tqlxy2vqvC1aJJQ1do9fqz8dKlT9U0zAVtw2Hs/ V X-Google-Smtp-Source: AGHT+IEuUPHjb2+3WT0tCy1KCSZjA7Zf/o5PSf7S+77g0yFu4ntzU7GGqL9+EPOpaktiW/rgd9hCqg== X-Received: by 2002:a05:6a20:258f:b0:1bd:18ee:f141 with SMTP id adf61e73a8af0-1bef611b9b9mr13399481637.4.1720049021504; Wed, 03 Jul 2024 16:23:41 -0700 (PDT) Received: from localhost ([2804:14d:7e39:8470:5d1c:5d1f:9410:579]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fac15695b4sm109505615ad.225.2024.07.03.16.23.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jul 2024 16:23:41 -0700 (PDT) From: Thiago Jung Bauermann To: gcc-patches@gcc.gnu.org Subject: [PATCH] testsuite: Fix pr115278.cc test when uint32_t isn't unsigned int Date: Wed, 3 Jul 2024 20:23:38 -0300 Message-ID: <20240703232338.242993-1-thiago.bauermann@linaro.org> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP 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: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org On arm-none-eabi, g++.dg/vect/pr115278.cc fails with: FAIL: g++.dg/vect/pr115278.cc -std=c++14 (test for excess errors) Excess errors: /path/to/gcc.git/gcc/testsuite/g++.dg/vect/pr115278.cc:24:28: error: invalid conversion from 'volatile unsigned int*' to 'volatile uint32_t*' {aka 'volatile long unsigned int*'} [-fpermissive] g++.dg/vect/pr115278.cc -std=c++14 : dump file does not exist UNRESOLVED: g++.dg/vect/pr115278.cc -std=c++14 scan-tree-dump-times optimized "\\*WRITE[^\r\n]* ={v} " 2 The problem is that the cast used to initialize the WRITE variable doesn't match the underlying type of uint32_t. Fix by using __UINT32_TYPE__ instead. Verified that after this change, the test still fails when reverting the fix for PR115278. Tested on: - Host x86_64-linux-gnu, target arm-unknown-eabi - Native armv8l-linux-gnueabihf - Native aarch64-linux-gnu - Native x86_64-linux-gnu gcc/testsuite/ * g++.dg/vect/pr115278.cc: Use __UINT32_TYPE__ in cast used to initialize WRITE. --- gcc/testsuite/g++.dg/vect/pr115278.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/testsuite/g++.dg/vect/pr115278.cc b/gcc/testsuite/g++.dg/vect/pr115278.cc index 331075fb2781..39a7537a3e6a 100644 --- a/gcc/testsuite/g++.dg/vect/pr115278.cc +++ b/gcc/testsuite/g++.dg/vect/pr115278.cc @@ -2,6 +2,7 @@ // { dg-require-effective-target c++11 } // { dg-additional-options "-fdump-tree-optimized" } +#include #include const int runs = 92; @@ -21,7 +22,7 @@ union BitfieldStructUnion { BitfieldStructUnion(uint32_t value_low, uint32_t value_high) : value_low(value_low), value_high(value_high) {} }; -volatile uint32_t *WRITE = (volatile unsigned*)0x42; +volatile uint32_t *WRITE = (volatile __UINT32_TYPE__*)0x42; void buggy() { for (int i = 0; i < runs; i++) {