public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-5932] Revert "This patch enables errors when external calls are created."
@ 2023-11-28 15:47 Cupertino Miranda
  0 siblings, 0 replies; only message in thread
From: Cupertino Miranda @ 2023-11-28 15:47 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:82273cd6ed19884549ea514ebe120f188297ace9

commit r14-5932-g82273cd6ed19884549ea514ebe120f188297ace9
Author: Cupertino Miranda <cupertino.miranda@oracle.com>
Date:   Tue Nov 28 15:44:53 2023 +0000

    Revert "This patch enables errors when external calls are created."
    
    Reverted commit was breaking the BPF build, because libgcc emits
    libcalls to __builtin_abort.
    
    This reverts commit faf5b148588bd7fbb60ec669aefa704044037cdc.

Diff:
---
 gcc/config/bpf/bpf.cc                            | 21 ---------------------
 gcc/testsuite/gcc.target/bpf/atomic-cmpxchg-2.c  |  2 +-
 gcc/testsuite/gcc.target/bpf/atomic-fetch-op-3.c |  2 +-
 gcc/testsuite/gcc.target/bpf/atomic-op-3.c       |  2 +-
 gcc/testsuite/gcc.target/bpf/atomic-xchg-2.c     |  2 +-
 gcc/testsuite/gcc.target/bpf/diag-sdiv.c         |  2 +-
 gcc/testsuite/gcc.target/bpf/diag-smod.c         |  2 +-
 7 files changed, 6 insertions(+), 27 deletions(-)

diff --git a/gcc/config/bpf/bpf.cc b/gcc/config/bpf/bpf.cc
index 80108018c24..4bfba289546 100644
--- a/gcc/config/bpf/bpf.cc
+++ b/gcc/config/bpf/bpf.cc
@@ -746,15 +746,6 @@ bpf_output_call (rtx target)
 	    xops[0] = GEN_INT (TREE_INT_CST_LOW (TREE_VALUE (attr_args)));
 	    output_asm_insn ("call\t%0", xops);
 	  }
-	else if (fndecl_built_in_p (decl))
-	  {
-	    /* For now lets report this as an error while we are not able to
-	       link eBPF object files.  In particular with libgcc.  */
-	    tree name = DECL_NAME (decl);
-	    error ("call to external builtin %s in function, which is not supported by "
-		   "eBPF", name != NULL_TREE ? IDENTIFIER_POINTER (name) : "(anon)");
-	    output_asm_insn ("call 0", NULL);
-	  }
 	else
 	  output_asm_insn ("call\t%0", &target);
 
@@ -774,18 +765,6 @@ bpf_output_call (rtx target)
   return "";
 }
 
-static void
-bpf_external_libcall (rtx fun)
-{
-  tree decl = SYMBOL_REF_DECL (fun);
-  tree name = DECL_NAME (decl);
-  error ("call to external libcall %s in function, which is not supported by "
-	 "eBPF", name != NULL_TREE ? IDENTIFIER_POINTER (name) : "(anon)");
-}
-
-#undef  TARGET_ASM_EXTERNAL_LIBCALL
-#define TARGET_ASM_EXTERNAL_LIBCALL bpf_external_libcall
-
 /* Print register name according to assembly dialect.  In normal
    syntax registers are printed like %rN where N is the register
    number.
diff --git a/gcc/testsuite/gcc.target/bpf/atomic-cmpxchg-2.c b/gcc/testsuite/gcc.target/bpf/atomic-cmpxchg-2.c
index fec720584e4..4036570ac60 100644
--- a/gcc/testsuite/gcc.target/bpf/atomic-cmpxchg-2.c
+++ b/gcc/testsuite/gcc.target/bpf/atomic-cmpxchg-2.c
@@ -6,7 +6,7 @@ foo (int *p, int *expected, int desired)
 {
   return __atomic_compare_exchange (p, expected, &desired, 0,
 				    __ATOMIC_ACQUIRE, __ATOMIC_RELAXED);
-} /* { dg-error "call to external builtin" } */
+}
 
 int
 foo64 (long *p, long *expected, long desired)
diff --git a/gcc/testsuite/gcc.target/bpf/atomic-fetch-op-3.c b/gcc/testsuite/gcc.target/bpf/atomic-fetch-op-3.c
index ea1b8e48928..044a2f76474 100644
--- a/gcc/testsuite/gcc.target/bpf/atomic-fetch-op-3.c
+++ b/gcc/testsuite/gcc.target/bpf/atomic-fetch-op-3.c
@@ -9,7 +9,7 @@ long
 test_atomic_fetch_add (long x)
 {
   return __atomic_fetch_add (&val, x, __ATOMIC_ACQUIRE);
-} /* { dg-error "call to external builtin" } */
+}
 
 long
 test_atomic_fetch_sub (long x)
diff --git a/gcc/testsuite/gcc.target/bpf/atomic-op-3.c b/gcc/testsuite/gcc.target/bpf/atomic-op-3.c
index fefafd6b748..b2ce2892634 100644
--- a/gcc/testsuite/gcc.target/bpf/atomic-op-3.c
+++ b/gcc/testsuite/gcc.target/bpf/atomic-op-3.c
@@ -20,7 +20,7 @@ void
 test_atomic_and (int x)
 {
   __atomic_and_fetch (&val, x, __ATOMIC_ACQUIRE);
-} /* { dg-error "call to external builtin" } */
+}
 
 void
 test_atomic_nand (int x)
diff --git a/gcc/testsuite/gcc.target/bpf/atomic-xchg-2.c b/gcc/testsuite/gcc.target/bpf/atomic-xchg-2.c
index eab695bf388..3b6324e966b 100644
--- a/gcc/testsuite/gcc.target/bpf/atomic-xchg-2.c
+++ b/gcc/testsuite/gcc.target/bpf/atomic-xchg-2.c
@@ -7,7 +7,7 @@ int foo (int *p, int *new)
   int old;
   __atomic_exchange (p, new, &old, __ATOMIC_RELAXED);
   return old;
-} /* { dg-error "call to external builtin" } */
+}
 
 int foo64 (long *p, long *new)
 {
diff --git a/gcc/testsuite/gcc.target/bpf/diag-sdiv.c b/gcc/testsuite/gcc.target/bpf/diag-sdiv.c
index c3332558e7d..c48bbf03df9 100644
--- a/gcc/testsuite/gcc.target/bpf/diag-sdiv.c
+++ b/gcc/testsuite/gcc.target/bpf/diag-sdiv.c
@@ -7,6 +7,6 @@ foo ()
 {
   signed int x = 5;
   signed int y = 2;
-  signed int z = x / y; /* { dg-error "call to external libcall" } */
+  signed int z = x / y;
 }
 /* { dg-final { scan-assembler-not "sdiv(32)?\t%r" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/diag-smod.c b/gcc/testsuite/gcc.target/bpf/diag-smod.c
index 25bcb1e4ffd..d3df308217f 100644
--- a/gcc/testsuite/gcc.target/bpf/diag-smod.c
+++ b/gcc/testsuite/gcc.target/bpf/diag-smod.c
@@ -7,6 +7,6 @@ foo ()
 {
   signed int x = 5;
   signed int y = 2;
-  signed int z = x % y; /* { dg-error "call to external libcall" } */
+  signed int z = x % y;
 }
 /* { dg-final { scan-assembler-not "smod(32)?\t%r" } } */

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

only message in thread, other threads:[~2023-11-28 15:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-28 15:47 [gcc r14-5932] Revert "This patch enables errors when external calls are created." Cupertino Miranda

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).