diff options
author | Alexandre Oliva <oliva@adacore.com> | 2020-12-03 16:20:28 -0300 |
---|---|---|
committer | Alexandre Oliva <oliva@gnu.org> | 2020-12-03 16:20:28 -0300 |
commit | 442b6fb7c09a39577261de90413cc4db366f1c5f (patch) | |
tree | 72fca0cbff303ab54fb255d15194067e0643adb2 /gcc/builtins.c | |
parent | 44ac1ea0e2244343b798ff1ccc7048029cb9fa02 (diff) | |
download | gcc-442b6fb7c09a39577261de90413cc4db366f1c5f.zip gcc-442b6fb7c09a39577261de90413cc4db366f1c5f.tar.gz gcc-442b6fb7c09a39577261de90413cc4db366f1c5f.tar.bz2 |
fix __builtin___clear_cache overrider fallout
Machines that had CLEAR_CACHE_INSN and that would thus issue calls to
__clear_cache with the default call expander, would fail on languages
that did not set up the __clear_cache builtin. This patch arranges
for all languages to set up this builtin.
Machines or multilibs that had ptr_mode != Pmode, such as aarch64 with
-mabi=ilp32, would fail the RTL mode test of the arguments passed to
__clear_cache, because we'd insist on ptr_mode. This patch arranges
for Pmode to be accepted as well.
for gcc/ChangeLog
* tree.c (build_common_builtin_nodes): Declare
__builtin___clear_cache for all languages.
* builtins.c (maybe_emit_call_builtin___clear_cache): Accept
Pmode arguments.
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r-- | gcc/builtins.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c index ecc12e6..cd30de8 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -7793,7 +7793,8 @@ default_emit_call_builtin___clear_cache (rtx begin, rtx end) void maybe_emit_call_builtin___clear_cache (rtx begin, rtx end) { - if (GET_MODE (begin) != ptr_mode || GET_MODE (end) != ptr_mode) + if ((GET_MODE (begin) != ptr_mode && GET_MODE (begin) != Pmode) + || (GET_MODE (end) != ptr_mode && GET_MODE (end) != Pmode)) { error ("both arguments to %<__builtin___clear_cache%> must be pointers"); return; |