From patchwork Wed Feb 21 02:19:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 86092 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 703DB3858404 for ; Wed, 21 Feb 2024 02:20:13 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id CD9653858D20 for ; Wed, 21 Feb 2024 02:19:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CD9653858D20 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=efficios.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=efficios.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CD9653858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708481985; cv=none; b=Tzd3t/mXEDFNPCu1br+V1yHbfv3/uI8ogFc/G+jAdbnq1qm2hbBmBL464/AQZNIfAYScZuqsp8jkFf47HvxjhwxhDNFXLP9E+VW3UuyhjKZj4GtWaWvQ72L05hxuUylUZdkN0HMQWR2OVAp0D3bc4qDfA/L3K0lVNvbQ7PaLiQI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708481985; c=relaxed/simple; bh=5xhNKToqAHJO9sI2d5YVM9EeQV4wqpD7ShNyDHpUTSc=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=DtXjlHac+QE1spn+98aU0ALBePBnf7+RsMzjVAEjxpocvhib+Iz/Q96tbxJq1d4xjeCl5xWkUcOLYNqFpwAoTxaGhKBWtU1gkNj9/PWXQiWFu6W2vBhSFXMwZUxnx1f8utGiM6AYHoJiM/sxbM+y+JO9m5fL4+tWv/KKVdP1m20= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from localhost.localdomain (modemcable238.237-201-24.mc.videotron.ca [24.201.237.238]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id E0FE21E092; Tue, 20 Feb 2024 21:19:40 -0500 (EST) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 1/2] gdb: remove some GCC version checks Date: Tue, 20 Feb 2024 21:19:11 -0500 Message-ID: <20240221021939.5213-1-simon.marchi@efficios.com> X-Mailer: git-send-email 2.43.2 MIME-Version: 1.0 X-Spam-Status: No, score=-1173.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_SOFTFAIL, 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: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Since we now require C++17, and therefore gcc >= 9, it's no longer useful to have gcc version checks for older gcc version. Change-Id: I3a87baa03c475f2b847b422b16b69c5ff7215b54 --- gdb/nat/x86-gcc-cpuid.h | 17 ----------------- gdb/unittests/enum-flags-selftests.c | 6 ------ gdbserver/tracepoint.h | 4 ---- gdbsupport/common-defs.h | 9 --------- 4 files changed, 36 deletions(-) base-commit: 67db6ada6370f24d344e91c2add203735292534c diff --git a/gdb/nat/x86-gcc-cpuid.h b/gdb/nat/x86-gcc-cpuid.h index dfd12587d813..b2eda44a2294 100644 --- a/gdb/nat/x86-gcc-cpuid.h +++ b/gdb/nat/x86-gcc-cpuid.h @@ -195,7 +195,6 @@ __get_cpuid_max (unsigned int __ext, unsigned int *__sig) #ifndef __x86_64__ /* See if we can use cpuid. On AMD64 we always can. */ -#if __GNUC__ >= 3 __asm__ ("pushf{l|d}\n\t" "pushf{l|d}\n\t" "pop{l}\t%0\n\t" @@ -208,22 +207,6 @@ __get_cpuid_max (unsigned int __ext, unsigned int *__sig) "popf{l|d}\n\t" : "=&r" (__eax), "=&r" (__ebx) : "i" (0x00200000)); -#else -/* Host GCCs older than 3.0 weren't supporting Intel asm syntax - nor alternatives in i386 code. */ - __asm__ ("pushfl\n\t" - "pushfl\n\t" - "popl\t%0\n\t" - "movl\t%0, %1\n\t" - "xorl\t%2, %0\n\t" - "pushl\t%0\n\t" - "popfl\n\t" - "pushfl\n\t" - "popl\t%0\n\t" - "popfl\n\t" - : "=&r" (__eax), "=&r" (__ebx) - : "i" (0x00200000)); -#endif if (!((__eax ^ __ebx) & 0x00200000)) return 0; diff --git a/gdb/unittests/enum-flags-selftests.c b/gdb/unittests/enum-flags-selftests.c index 853ebca37823..607b8ac66a64 100644 --- a/gdb/unittests/enum-flags-selftests.c +++ b/gdb/unittests/enum-flags-selftests.c @@ -253,10 +253,8 @@ CHECK_VALID (true, EF, true ? RE () : EF ()) CHECK_VALID (true, int, true ? EF () : EF2 ()) CHECK_VALID (true, int, true ? EF2 () : EF ()) -#if GCC_VERSION >= 5003 || defined __clang__ CHECK_VALID (true, int, true ? EF () : RE2 ()) CHECK_VALID (true, int, true ? RE2 () : EF ()) -#endif /* Same, but with an unsigned enum. */ @@ -264,10 +262,8 @@ typedef unsigned int uns; CHECK_VALID (true, uns, true ? EF () : UEF ()) CHECK_VALID (true, uns, true ? UEF () : EF ()) -#if GCC_VERSION >= 5003 || defined __clang__ CHECK_VALID (true, uns, true ? EF () : URE ()) CHECK_VALID (true, uns, true ? URE () : EF ()) -#endif /* Unfortunately this can't work due to the way C++ computes the return type of the ternary conditional operator. int isn't @@ -279,10 +275,8 @@ CHECK_VALID (true, uns, true ? URE () : EF ()) error: operands to ?: have different types ‘enum_flags’ and ‘int’ Confirmed to work with gcc 4.9, 5.3 and clang 3.7. */ -#if GCC_VERSION >= 4009 || defined __clang__ CHECK_VALID (false, void, true ? EF () : 0) CHECK_VALID (false, void, true ? 0 : EF ()) -#endif /* Check that the ++/--/<>/<<=/>>= operators are deleted. */ diff --git a/gdbserver/tracepoint.h b/gdbserver/tracepoint.h index 8b232324d2ec..6369e91aa276 100644 --- a/gdbserver/tracepoint.h +++ b/gdbserver/tracepoint.h @@ -38,11 +38,7 @@ void initialize_tracepoint (void); #if defined _WIN32 || defined __CYGWIN__ # define EXPORTED_SYMBOL __declspec (dllexport) #else -# if __GNUC__ >= 4 # define EXPORTED_SYMBOL __attribute__ ((visibility ("default"))) -# else -# define EXPORTED_SYMBOL -# endif #endif /* Use these to make sure the functions and variables the IPA needs to diff --git a/gdbsupport/common-defs.h b/gdbsupport/common-defs.h index 8ec559e9b680..6120719480b8 100644 --- a/gdbsupport/common-defs.h +++ b/gdbsupport/common-defs.h @@ -187,17 +187,8 @@ #undef ATTRIBUTE_NONNULL #define ATTRIBUTE_NONNULL(m) -#if GCC_VERSION >= 3004 #define ATTRIBUTE_UNUSED_RESULT __attribute__ ((__warn_unused_result__)) -#else -#define ATTRIBUTE_UNUSED_RESULT -#endif - -#if (GCC_VERSION > 4000) #define ATTRIBUTE_USED __attribute__ ((__used__)) -#else -#define ATTRIBUTE_USED -#endif #include "libiberty.h" #include "pathmax.h"