From: Eric Botcazou Date: Tue, 28 May 2019 07:21:07 +0000 (+0000) Subject: decl.c (intrin_arglists_compatible_p): Do not return false if the internal builtin... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=eabf2b44483427d54be93ae7628065aa08c4a1e6;p=gcc.git decl.c (intrin_arglists_compatible_p): Do not return false if the internal builtin uses a variable list. * gcc-interface/decl.c (intrin_arglists_compatible_p): Do not return false if the internal builtin uses a variable list. From-SVN: r271679 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 8c3e7fb88ae..377b13e0ecc 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2019-05-28 Eric Botcazou + + * gcc-interface/decl.c (intrin_arglists_compatible_p): Do not return + false if the internal builtin uses a variable list. + 2019-05-27 Eric Botcazou * gcc-interface/trans.c (Call_to_gnu): Do not initialize the temporary diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index ed015baa57f..9082d44ea5c 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -9174,9 +9174,9 @@ intrin_arglists_compatible_p (intrin_binding_t * inb) if (!ada_type && !btin_type) break; - /* If one list is shorter than the other, they fail to match. */ - if (!ada_type || !btin_type) - return false; + /* If the internal builtin uses a variable list, accept anything. */ + if (!btin_type) + break; /* If we're done with the Ada args and not with the internal builtin args, or the other way around, complain. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index eb2530580e5..633ecfc5b31 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2019-05-28 Eric Botcazou + + * gnat.dg/prefetch1.ad[sb]: New test. + 2019-05-27 Iain Sandoe * gcc.target/i386/pr22076.c: Adjust options to diff --git a/gcc/testsuite/gnat.dg/prefetch1.adb b/gcc/testsuite/gnat.dg/prefetch1.adb new file mode 100644 index 00000000000..2233da488ef --- /dev/null +++ b/gcc/testsuite/gnat.dg/prefetch1.adb @@ -0,0 +1,29 @@ +-- { dg-do compile } + +package body Prefetch1 is + + procedure Prefetch_1 (Addr : System.Address); + pragma Import (Intrinsic, Prefetch_1, "__builtin_prefetch"); + + procedure Prefetch_2 (Addr : System.Address; RW : Integer); + pragma Import (Intrinsic, Prefetch_2, "__builtin_prefetch"); + + procedure Prefetch_3 (Addr : System.Address; RW : Integer; Locality : Integer); + pragma Import (Intrinsic, Prefetch_3, "__builtin_prefetch"); + + procedure My_Proc1 (Addr : System.Address) is + begin + Prefetch_1 (Addr); + end; + + procedure My_Proc2 (Addr : System.Address) is + begin + Prefetch_2 (Addr, 1); + end; + + procedure My_Proc3 (Addr : System.Address) is + begin + Prefetch_3 (Addr, 1, 1); + end; + +end Prefetch1; diff --git a/gcc/testsuite/gnat.dg/prefetch1.ads b/gcc/testsuite/gnat.dg/prefetch1.ads new file mode 100644 index 00000000000..fdb655afa73 --- /dev/null +++ b/gcc/testsuite/gnat.dg/prefetch1.ads @@ -0,0 +1,9 @@ +with System; + +package Prefetch1 is + + procedure My_Proc1 (Addr : System.Address); + procedure My_Proc2 (Addr : System.Address); + procedure My_Proc3 (Addr : System.Address); + +end Prefetch1;