public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/vendors/ARM/heads/morello)] Automatically add `+c64` to `-march=morello -mabi=purecap`
@ 2022-11-30 15:04 Matthew Malcomson
  0 siblings, 0 replies; only message in thread
From: Matthew Malcomson @ 2022-11-30 15:04 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:866155e7fafe87bb88cbe070e5206af953505927

commit 866155e7fafe87bb88cbe070e5206af953505927
Author: Matthew Malcomson <matthew.malcomson@arm.com>
Date:   Wed Nov 30 15:03:17 2022 +0000

    Automatically add `+c64` to `-march=morello -mabi=purecap`
    
    This is a convenience feature, it is already in Morello LLVM.
    This commit reduces the difference between the two compilers in the user
    facing controls.

Diff:
---
 gcc/config/aarch64/aarch64.c                               | 9 +++++++--
 gcc/testsuite/gcc.target/aarch64/morello/cli-convenience.c | 7 +++++++
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index bfe5a312134..662d2bb6403 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -15402,11 +15402,16 @@ aarch64_override_options_internal (struct gcc_options *opts)
      what state the processor should be in (which also defines some parts of
      the ABI like whether symbol values should have their lowest bit set).
      If we want to generate purecap code we will need the processor to be in
-     the C64 state.  */
+     the C64 state.
+
+     We automatically add this architecture feature without complaint when
+     targeting the -march=morello architecture.  This is a command line
+     argument convenience feature.  */
   if (opts->x_aarch64_abi == AARCH64_ABI_MORELLO_PURECAP
       && !AARCH64_ISA_C64)
     {
-      error ("%<-mabi=purecap%> requires the %<+c64%> extension");
+      if (selected_arch->arch != AARCH64_ARCH_MORELLO)
+	error ("%<-mabi=purecap%> requires the %<morello%> architecture");
       aarch64_isa_flags |= AARCH64_FL_C64;
     }
 
diff --git a/gcc/testsuite/gcc.target/aarch64/morello/cli-convenience.c b/gcc/testsuite/gcc.target/aarch64/morello/cli-convenience.c
new file mode 100644
index 00000000000..46eec5ee9d5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/morello/cli-convenience.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-march=morello -mabi=purecap" } */
+int foo(int *ptr)
+{
+  return *ptr;
+}
+/* { scan-assembler "c0" } */

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-11-30 15:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-30 15:04 [gcc(refs/vendors/ARM/heads/morello)] Automatically add `+c64` to `-march=morello -mabi=purecap` Matthew Malcomson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).