The memtag builtins were being GC'ed away so we end up
with a crash sometimes (maybe even wrong code).
This fixes that issue by adding GTY on the variable/struct
aarch64_memtag_builtin_data.
Committed as obvious after a build/test for aarch64-linux-gnu.
PR target/108174
gcc/ChangeLog:
* config/aarch64/aarch64-builtins.cc (aarch64_memtag_builtin_data): Make
static and mark with GTY.
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/acle/memtag_4.c: New test.
Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
}
/* Initialize the memory tagging extension (MTE) builtins. */
-struct
+static GTY(()) struct GTY(())
{
tree ftype;
enum insn_code icode;
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-march=armv9-a+memtag --param ggc-min-expand=0 --param ggc-min-heapsize=0" } */
+/* PR target/108174 */
+/* Check to make sure that the builtin functions are not GC'ed away. */
+#include "arm_acle.h"
+
+void g(void)
+{
+ const char *c;
+ __arm_mte_increment_tag(c , 0 );
+}
+void h(void)
+{
+ const char *c;
+ __arm_mte_increment_tag( c,0);
+}