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

--- Comment #10 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #9)
> Actually I think a better way of fixing this is adding nothrow and leaf
> attributes to __builtin_aarch64_im_lane_boundsi . Since this function will
> either error out or be folded into nothing.
> Plus this will help out basic block handling anyways.

diff --git a/gcc/config/aarch64/aarch64-builtins.cc
b/gcc/config/aarch64/aarch64-builtins.cc
index b860e22f01f..1bdc828d76e 100644
--- a/gcc/config/aarch64/aarch64-builtins.cc
+++ b/gcc/config/aarch64/aarch64-builtins.cc
@@ -1482,10 +1482,12 @@ aarch64_init_simd_builtin_functions (bool
called_from_pragma)
                                                      size_type_node,
                                                      intSI_type_node,
                                                      NULL);
+      tree attrs = aarch64_add_attribute ("nothrow", NULL_TREE);
+      attrs = aarch64_add_attribute ("leaf", attrs);
       aarch64_builtin_decls[AARCH64_SIMD_BUILTIN_LANE_CHECK]
        = aarch64_general_add_builtin ("__builtin_aarch64_im_lane_boundsi",
                                       lane_check_fpr,
-                                      AARCH64_SIMD_BUILTIN_LANE_CHECK);
+                                      AARCH64_SIMD_BUILTIN_LANE_CHECK, attrs);
     }

   for (i = 0; i < ARRAY_SIZE (aarch64_simd_builtin_data); i++, fcode++)


Better anyways.

Reply via email to