[Ada] Add support for __builtin_prefetch

Message ID 31820185.k8ba9VVp70@polaris
State New
Headers show
Series
  • [Ada] Add support for __builtin_prefetch
Related show

Commit Message

Eric Botcazou May 28, 2019, 7:21 a.m.
This adds support for __builtin_prefetch in Ada.

Tested on x86_64-suse-linux, applied on the mainline.


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-28  Eric Botcazou  <ebotcazou@adacore.com>

	* gnat.dg/prefetch1.ad[sb]: New test.

-- 
Eric Botcazou

Patch

Index: gcc-interface/decl.c
===================================================================
--- gcc-interface/decl.c	(revision 271528)
+++ gcc-interface/decl.c	(working copy)
@@ -9174,9 +9174,9 @@  intrin_arglists_compatible_p (intrin_bin
       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.  */