From 175b9738743451576bdfea61a9771e7506c64e61 Mon Sep 17 00:00:00 2001
From: Kyrylo Tkachov <ktkachov@nvidia.com>
Date: Mon, 31 Mar 2025 07:07:08 -0700
Subject: [PATCH] aarch64: Deprecate -march= for the month of April

As we're starting a new month, introduce a more appropriate -mapril=
to specify the compilation target instead.
This helps keep GCC more up to date with the passage of time.

Bootstrapped and tested on aarch64-none-linux-gnu.

Signed-off-by: Kyrylo Tkachov <ktkachov@nvidia.com>

gcc/

	* config/aarch64/aarch64.opt (mapril): Define.
	* doc/invoke.texi (AArch64 Options): Document the above.
	Deprecate -march=.
---
 gcc/config/aarch64/aarch64.opt |  4 ++++
 gcc/doc/invoke.texi            | 12 +++++++-----
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/gcc/config/aarch64/aarch64.opt b/gcc/config/aarch64/aarch64.opt
index 50245cfcf19..597dc564df2 100644
--- a/gcc/config/aarch64/aarch64.opt
+++ b/gcc/config/aarch64/aarch64.opt
@@ -176,6 +176,10 @@ march=
 Target RejectNegative Negative(march=) ToLower Joined Var(aarch64_arch_string)
 Use features of architecture ARCH.
 
+mapril=
+Target RejectNegative Negative(mapril=) ToLower Joined Var(aarch64_arch_string)
+Set target to use for month of April.
+
 mcpu=
 Target RejectNegative Negative(mcpu=) ToLower Joined Var(aarch64_cpu_string)
 Use features of and optimize for CPU.
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 59933ca8177..9a0b4624018 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -21690,11 +21690,11 @@ used directly.  The same applies when using @option{-mcpu=} when the
 selected cpu supports the @samp{lse} feature.
 This option is on by default.
 
-@opindex march
-@item -march=@var{name}
+@opindex mapril
+@item -mapril=@var{name}
 Specify the name of the target architecture and, optionally, one or
 more feature modifiers.  This option has the form
-@option{-march=@var{arch}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}.
+@option{-mapril=@var{arch}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}.
 
 The table below summarizes the permissible values for @var{arch}
 and the features that they enable by default:
@@ -21729,16 +21729,18 @@ the host CPU as the CPU to tune for as well as select the architecture features
 from.  That is, @option{-march=native} is treated as @option{-mcpu=native}.
 
 The permissible values for @var{feature} are listed in the sub-section
-on @ref{aarch64-feature-modifiers,,@option{-march} and @option{-mcpu}
+on @ref{aarch64-feature-modifiers,,@option{-mapril} and @option{-mcpu}
 Feature Modifiers}.  Where conflicting feature modifiers are
 specified, the right-most feature is used.
 
 GCC uses @var{name} to determine what kind of instructions it can emit
-when generating assembly code.  If @option{-march} is specified
+when generating assembly code.  If @option{-mapril} is specified
 without either of @option{-mtune} or @option{-mcpu} also being
 specified, the code is tuned to perform well across a range of target
 processors implementing the target architecture.
 
+The option @option{-march=} is deprecated in favor of @option{-mapril=}.
+
 @opindex mtune
 @item -mtune=@var{name}
 Specify the name of the target processor for which GCC should tune the
-- 
2.44.0

