introduce overridable clear_cache emitter

Alexandre Oliva oliva@adacore.com
Thu Dec 10 10:58:26 GMT 2020


On Dec  3, 2020, Alexandre Oliva <oliva@adacore.com> wrote:

> +    local_define_builtin ("__builtin___clear_cache", ftype,
> +			  BUILT_IN_CLEAR_CACHE,
> +			  "__builtin___clear_cache",
> +			  ECF_NOTHROW);

Ugh, so that somehow worked for aarch64-linux-gnu-gfortran, but the
aarch64-elf Ada compiler started issuing calls to an undefined
__builtin___clear_cache symbol.

The second string actual passed to local_define_builtin binds to formal
libname, which explains at least the new problem.  I've so far
restrained my curiosity as to why it wasn't a problem on
aarch64-linux-gnu-gfortran.  I'm checking it in as obvious, so far
lightly tested on x86_64-linux-gnu and -x-aarch64-elf.


drop __builtin_ from __clear_cache libname

From: Alexandre Oliva <oliva@adacore.com>

I made a cut&pasto in my previous patch for tree.c, causing platforms
that have CLEAR_INSN_CACHE defined, and none of the internal
__clear_cache expansion overriders, to issue calls to symbols named
__builtin___clear_cache rather than __clear_cache, on languages other
than those in the C family.  Oops.

This patch removes __builtin_ from the string used as the libname for
__buuiltin___clear_cache.


for  gcc/ChangeLog

	* tree.c (build_common_builtin_nodes): Drop __builtin_ from
	__clear_cache libname.
---
 gcc/tree.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/tree.c b/gcc/tree.c
index 72311005f57b2..4eb365205e3bd 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -10736,7 +10736,7 @@ build_common_builtin_nodes (void)
   if (!builtin_decl_explicit_p (BUILT_IN_CLEAR_CACHE))
     local_define_builtin ("__builtin___clear_cache", ftype,
 			  BUILT_IN_CLEAR_CACHE,
-			  "__builtin___clear_cache",
+			  "__clear_cache",
 			  ECF_NOTHROW);
 
   local_define_builtin ("__builtin_nonlocal_goto", ftype,


-- 
Alexandre Oliva, happy hacker  https://FSFLA.org/blogs/lxo/
   Free Software Activist         GNU Toolchain Engineer
        Vim, Vi, Voltei pro Emacs -- GNUlius Caesar


More information about the Gcc-patches mailing list