https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112989

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rsandifo at gcc dot gnu.org

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Here is where the 2 builtins are added:
```
Breakpoint 1, aarch64_sve::function_builder::add_function (this=0x7fffffffd980,
instance=..., name=0x31d4ca0 "svmla_za64_vg4x1", fntype=0x7ffff7434930,
attrs=0x0, required_extensions=5497558138885, overloaded_p=true,
placeholder_p=true) at ../../gcc/config/aarch64/aarch64-sve-builtins.cc:1478
1478        if (t != 0)
(gdb) bt
#0  aarch64_sve::function_builder::add_function (this=0x7fffffffd980,
instance=..., name=0x31d4ca0 "svmla_za64_vg4x1", fntype=0x7ffff7434930,
attrs=0x0, required_extensions=5497558138885, overloaded_p=true,
placeholder_p=true) at ../../gcc/config/aarch64/aarch64-sve-builtins.cc:1478
#1  0x00000000017ddeb5 in
aarch64_sve::function_builder::add_overloaded_function (this=0x7fffffffd980,
instance=..., required_extensions=5497558138885) at
../../gcc/config/aarch64/aarch64-sve-builtins.cc:1581
#2  0x00000000017ddf7d in operator() (__closure=0x7fffffffd900, types=...,
group_suffix_id=aarch64_sve::GROUP_vg4x1, pi=0) at
../../gcc/config/aarch64/aarch64-sve-builtins.cc:1604
#3  0x00000000017de087 in operator() (__closure=0x7fffffffd8d0,
group_suffix_id=aarch64_sve::GROUP_vg4x1, pi=0) at
../../gcc/config/aarch64/aarch64-sve-builtins.cc:1628
#4  0x00000000017de1c4 in
aarch64_sve::function_builder::add_overloaded_functions (this=0x7fffffffd980,
group=..., mode=aarch64_sve::MODE_none) at
../../gcc/config/aarch64/aarch64-sve-builtins.cc:1635
#5  0x00000000017f483d in aarch64_sve::binary_za_slice_opt_single_def::build
(this=<optimized out>, b=..., group=...) at
../../gcc/config/aarch64/aarch64-sve-builtins-shapes.cc:1894
#6  0x00000000017de25d in
aarch64_sve::function_builder::register_function_group (this=0x7fffffffd980,
group=...) at ../../gcc/config/aarch64/aarch64-sve-builtins.cc:1644
#7  0x00000000017e771b in aarch64_sve::handle_arm_sve_h () at
../../gcc/config/aarch64/aarch64-sve-builtins.cc:4595
#8  0x0000000000da3d75 in aarch64_pragma_aarch64 () at
../../gcc/config/aarch64/aarch64-c.cc:347
#9  0x0000000000bf022f in cp_parser_pragma (parser=0x7ffff73409d8,
context=pragma_external, if_p=0x0) at ../../gcc/cp/parser.cc:50751
#10 0x0000000000c2c2ac in cp_parser_toplevel_declaration
(parser=0x7ffff73409d8) at ../../gcc/cp/parser.cc:15392
#11 cp_parser_toplevel_declaration (parser=0x7ffff73409d8) at
../../gcc/cp/parser.cc:15383
#12 cp_parser_translation_unit (parser=0x7ffff73409d8) at
../../gcc/cp/parser.cc:5273
#13 c_parse_file () at ../../gcc/cp/parser.cc:50845
#14 0x0000000000d741d2 in c_common_parse_file () at
../../gcc/c-family/c-opts.cc:1301
#15 0x000000000133917e in compile_file () at ../../gcc/toplev.cc:446
#16 0x0000000000a4b151 in do_compile () at ../../gcc/toplev.cc:2150
#17 toplev::main (this=this@entry=0x7fffffffdd5e, argc=<optimized out>,
argc@entry=4, argv=<optimized out>, argv@entry=0x7fffffffde88) at
../../gcc/toplev.cc:2306
#18 0x0000000000a4d1ef in main (argc=4, argv=0x7fffffffde88) at
../../gcc/main.cc:39
(gdb) c
Continuing.

Breakpoint 1, aarch64_sve::function_builder::add_function (this=0x7fffffffd980,
instance=..., name=0x31d4d20 "svmla_za64_vg4x1", fntype=0x7ffff640fe70,
attrs=0x7ffff64c4aa0, required_extensions=5497558138885, overloaded_p=false,
placeholder_p=false) at ../../gcc/config/aarch64/aarch64-sve-builtins.cc:1478
1478        if (t != 0)
(gdb) bt
#0  aarch64_sve::function_builder::add_function (this=0x7fffffffd980,
instance=..., name=0x31d4d20 "svmla_za64_vg4x1", fntype=0x7ffff640fe70,
attrs=0x7ffff64c4aa0, required_extensions=5497558138885, overloaded_p=false,
placeholder_p=false) at ../../gcc/config/aarch64/aarch64-sve-builtins.cc:1478
#1  0x00000000017ddd0a in aarch64_sve::function_builder::add_unique_function
(this=0x7fffffffd980, instance=..., return_type=0x7ffff7421f18,
argument_types=..., required_extensions=5497558138885,
force_direct_overloads=false) at
../../gcc/config/aarch64/aarch64-sve-builtins.cc:1549
#2  0x00000000017ef6da in aarch64_sve::build_one (b=..., signature=<optimized
out>, group=..., mode_suffix_id=<optimized out>, ti=<optimized out>,
gi=<optimized out>, pi=0, force_direct_overloads=false) at
../../gcc/config/aarch64/aarch64-sve-builtins-shapes.cc:331
#3  0x00000000017ef7f9 in aarch64_sve::build_all (b=...,
signature=signature@entry=0x263bcd7 "_,su32,t1,t1", group=...,
mode_suffix_id=mode_suffix_id@entry=aarch64_sve::MODE_none,
force_direct_overloads=force_direct_overloads@entry=false) at
../../gcc/config/aarch64/aarch64-sve-builtins-shapes.cc:470
#4  0x00000000017f4855 in aarch64_sve::binary_za_slice_opt_single_def::build
(this=<optimized out>, b=..., group=...) at
../../gcc/config/aarch64/aarch64-sve-builtins-shapes.cc:1895
#5  0x00000000017de25d in
aarch64_sve::function_builder::register_function_group (this=0x7fffffffd980,
group=...) at ../../gcc/config/aarch64/aarch64-sve-builtins.cc:1644
#6  0x00000000017e771b in aarch64_sve::handle_arm_sve_h () at
../../gcc/config/aarch64/aarch64-sve-builtins.cc:4595
#7  0x0000000000da3d75 in aarch64_pragma_aarch64 () at
../../gcc/config/aarch64/aarch64-c.cc:347
#8  0x0000000000bf022f in cp_parser_pragma (parser=0x7ffff73409d8,
context=pragma_external, if_p=0x0) at ../../gcc/cp/parser.cc:50751
#9  0x0000000000c2c2ac in cp_parser_toplevel_declaration
(parser=0x7ffff73409d8) at ../../gcc/cp/parser.cc:15392
#10 cp_parser_toplevel_declaration (parser=0x7ffff73409d8) at
../../gcc/cp/parser.cc:15383
#11 cp_parser_translation_unit (parser=0x7ffff73409d8) at
../../gcc/cp/parser.cc:5273
#12 c_parse_file () at ../../gcc/cp/parser.cc:50845
#13 0x0000000000d741d2 in c_common_parse_file () at
../../gcc/c-family/c-opts.cc:1301
#14 0x000000000133917e in compile_file () at ../../gcc/toplev.cc:446
#15 0x0000000000a4b151 in do_compile () at ../../gcc/toplev.cc:2150
#16 toplev::main (this=this@entry=0x7fffffffdd5e, argc=<optimized out>,
argc@entry=4, argv=<optimized out>, argv@entry=0x7fffffffde88) at
../../gcc/toplev.cc:2306
#17 0x0000000000a4d1ef in main (argc=4, argv=0x7fffffffde88) at
../../gcc/main.cc:39

```

I used this small patch to debug it:
```
diff --git a/gcc/config/aarch64/aarch64-sve-builtins.cc
b/gcc/config/aarch64/aarch64-sve-builtins.cc
index 15fa5907de5..4f285f47750 100644
--- a/gcc/config/aarch64/aarch64-sve-builtins.cc
+++ b/gcc/config/aarch64/aarch64-sve-builtins.cc
@@ -1472,6 +1472,13 @@ function_builder::add_function (const function_instance
&instance,
 {
   unsigned int code = vec_safe_length (registered_functions);
   code = (code << AARCH64_BUILTIN_SHIFT) | AARCH64_BUILTIN_SVE;
+  if (strcmp (name, "svmla_za64_vg4x1") == 0)
+  {
+    static int t = 0;
+    if (t != 0)
+      gcc_unreachable();
+    t++;
+  }

   /* We need to be able to generate placeholders to enusre that we have a
      consistent numbering scheme for function codes between the C and C++

```

Reply via email to