]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Revert "This patch enables errors when external calls are created."
authorCupertino Miranda <cupertino.miranda@oracle.com>
Tue, 28 Nov 2023 15:44:53 +0000 (15:44 +0000)
committerCupertino Miranda <cupertino.miranda@oracle.com>
Tue, 28 Nov 2023 15:47:32 +0000 (15:47 +0000)
Reverted commit was breaking the BPF build, because libgcc emits
libcalls to __builtin_abort.

This reverts commit faf5b148588bd7fbb60ec669aefa704044037cdc.

gcc/config/bpf/bpf.cc
gcc/testsuite/gcc.target/bpf/atomic-cmpxchg-2.c
gcc/testsuite/gcc.target/bpf/atomic-fetch-op-3.c
gcc/testsuite/gcc.target/bpf/atomic-op-3.c
gcc/testsuite/gcc.target/bpf/atomic-xchg-2.c
gcc/testsuite/gcc.target/bpf/diag-sdiv.c
gcc/testsuite/gcc.target/bpf/diag-smod.c

index 80108018c24fde1ee3cec5209364359cb4855616..4bfba289546cac9b208e37ea32337ac4a55382d9 100644 (file)
@@ -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.
index fec720584e48aac303a2252f7b96e2dc4e970d6c..4036570ac6015f956741f56a7090d41c02c86163 100644 (file)
@@ -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)
index ea1b8e48928a83b0967008ec3ddd34b92673f5b4..044a2f76474b8a086cb185f926766d0607c4e973 100644 (file)
@@ -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)
index fefafd6b748f8d41faaf6be694c7478c3a97cf69..b2ce28926347b7956040f61b5e273fec6b657c6c 100644 (file)
@@ -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)
index eab695bf388cdb7482f6308a831b13a2b63bb18f..3b6324e966b85bd31613fb9000e7bcc022f52020 100644 (file)
@@ -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)
 {
index c3332558e7d265dd71d4baf8351764c4958d939c..c48bbf03df976ef8ce875fa9692fc1396fecfd1e 100644 (file)
@@ -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" } } */
index 25bcb1e4ffdb9e7d5493537fcc4642f0f1081238..d3df308217f3322ecb0c97599c0ad604a218fc3e 100644 (file)
@@ -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" } } */