]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
decl.c (intrin_arglists_compatible_p): Do not return false if the internal builtin...
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 28 May 2019 07:21:07 +0000 (07:21 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Tue, 28 May 2019 07:21:07 +0000 (07:21 +0000)
* gcc-interface/decl.c (intrin_arglists_compatible_p): Do not return
false if the internal builtin uses a variable list.

From-SVN: r271679

gcc/ada/ChangeLog
gcc/ada/gcc-interface/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/prefetch1.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/prefetch1.ads [new file with mode: 0644]

index 8c3e7fb88ae1b67252daa529ef2028a129fcd002..377b13e0ecccd82bbdf368013a3f7a41dc0cb9ce 100644 (file)
@@ -1,3 +1,8 @@
+2019-05-28  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * 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  <ebotcazou@adacore.com>
 
        * gcc-interface/trans.c (Call_to_gnu): Do not initialize the temporary
index ed015baa57f6e9e8830d2bfe2b5c9c9f2bf77df7..9082d44ea5c3b922cd0761db42be70c442c2c4a9 100644 (file)
@@ -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.  */
index eb2530580e5937258232d086978b538b0137351c..633ecfc5b317278d989fd6ce7ad8661e0861270e 100644 (file)
@@ -1,3 +1,7 @@
+2019-05-28  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gnat.dg/prefetch1.ad[sb]: New test.
+
 2019-05-27  Iain Sandoe  <iain@sandoe.co.uk>
 
        * 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 (file)
index 0000000..2233da4
--- /dev/null
@@ -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 (file)
index 0000000..fdb655a
--- /dev/null
@@ -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;